@@ -44,7 +44,7 @@ declare_lint_pass!(PathsFromFormat => [PATHS_FROM_FORMAT]);
44
44
impl < ' tcx > LateLintPass < ' tcx > for PathsFromFormat {
45
45
fn check_expr ( & mut self , cx : & LateContext < ' tcx > , expr : & ' tcx Expr < ' _ > ) {
46
46
if_chain ! {
47
- if let ExprKind :: Call ( _, args) = expr. kind;
47
+ if let ExprKind :: Call ( _, [ args, .. ] ) = expr. kind;
48
48
if let ty = cx. typeck_results( ) . expr_ty( expr) ;
49
49
if is_type_diagnostic_item( cx, ty, sym:: PathBuf ) ;
50
50
if !args. is_empty( ) ;
@@ -54,9 +54,15 @@ impl<'tcx> LateLintPass<'tcx> for PathsFromFormat {
54
54
then {
55
55
let format_string_parts = format_args. format_string. parts;
56
56
let format_value_args = format_args. args;
57
- let string_parts: Vec <& str > = format_string_parts. iter( ) . map( rustc_span:: Symbol :: as_str) . collect( ) ;
57
+ let string_parts: Vec <& str > = format_string_parts
58
+ . iter( )
59
+ . map( rustc_span:: Symbol :: as_str)
60
+ . collect( ) ;
58
61
let mut applicability = Applicability :: MachineApplicable ;
59
- let real_vars: Vec <Sugg <' _>> = format_value_args. iter( ) . map( |x| Sugg :: hir_with_applicability( cx, x. param. value, ".." , & mut applicability) ) . collect( ) ;
62
+ let real_vars: Vec <Sugg <' _>> = format_value_args
63
+ . iter( )
64
+ . map( |x| Sugg :: hir_with_applicability( cx, x. param. value, ".." , & mut applicability) )
65
+ . collect( ) ;
60
66
let mut paths_zip = string_parts. iter( ) . take( real_vars. len( ) ) . zip( real_vars. clone( ) ) ;
61
67
let mut sugg = String :: new( ) ;
62
68
if let Some ( ( part, arg) ) = paths_zip. next( ) {
0 commit comments