File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
crates/ruff_linter/src/rules/flake8_logging_format/rules Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ fn logging_f_string(
2929 }
3030
3131 let mut format_string = String :: new ( ) ;
32- let mut args = Vec :: new ( ) ;
32+ let mut args: Vec < & str > = Vec :: new ( ) ;
3333
3434 // Try to reuse the first part's quote style when building the replacement.
3535 // Default to double quotes if we can't determine it.
@@ -64,7 +64,7 @@ fn logging_f_string(
6464 match interpolated. expression . as_ref ( ) {
6565 Expr :: Name ( name) => {
6666 format_string. push_str ( "%s" ) ;
67- args. push ( name. id . to_string ( ) ) ;
67+ args. push ( name. id . as_str ( ) ) ;
6868 }
6969 _ => return ,
7070 }
@@ -78,12 +78,12 @@ fn logging_f_string(
7878 }
7979
8080 // Determine names of existing trailing positional args (after the `msg` argument).
81- let existing_names: Vec < String > = arguments
81+ let existing_names: Vec < & str > = arguments
8282 . args
8383 . iter ( )
8484 . skip ( msg_pos + 1 )
8585 . filter_map ( |arg| match arg {
86- Expr :: Name ( name) => Some ( name. id . to_string ( ) ) ,
86+ Expr :: Name ( name) => Some ( name. id . as_str ( ) ) ,
8787 _ => None ,
8888 } )
8989 . collect ( ) ;
You can’t perform that action at this time.
0 commit comments