@@ -44,7 +44,7 @@ declare_lint_pass!(PathsFromFormat => [PATHS_FROM_FORMAT]);
4444impl < ' tcx > LateLintPass < ' tcx > for PathsFromFormat {
4545 fn check_expr ( & mut self , cx : & LateContext < ' tcx > , expr : & ' tcx Expr < ' _ > ) {
4646 if_chain ! {
47- if let ExprKind :: Call ( _, args) = expr. kind;
47+ if let ExprKind :: Call ( _, [ args, .. ] ) = expr. kind;
4848 if let ty = cx. typeck_results( ) . expr_ty( expr) ;
4949 if is_type_diagnostic_item( cx, ty, sym:: PathBuf ) ;
5050 if !args. is_empty( ) ;
@@ -54,9 +54,15 @@ impl<'tcx> LateLintPass<'tcx> for PathsFromFormat {
5454 then {
5555 let format_string_parts = format_args. format_string. parts;
5656 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( ) ;
5861 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( ) ;
6066 let mut paths_zip = string_parts. iter( ) . take( real_vars. len( ) ) . zip( real_vars. clone( ) ) ;
6167 let mut sugg = String :: new( ) ;
6268 if let Some ( ( part, arg) ) = paths_zip. next( ) {
0 commit comments