Skip to content

Commit 7fe226f

Browse files
committed
Check write_args length
1 parent eb0c13c commit 7fe226f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

clippy_lints/src/explicit_write.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
5555
if let ExprKind::MethodCall(ref write_fun, _, ref write_args) =
5656
unwrap_args[0].node;
5757
// Obtain the string that should be printed
58+
if write_args.len() > 1;
5859
if let ExprKind::Call(_, ref output_args) = write_args[1].node;
5960
if let ExprKind::AddrOf(_, ref output_string_expr) = output_args[0].node;
6061
if let ExprKind::Array(ref string_exprs) = output_string_expr.node;

0 commit comments

Comments
 (0)