@@ -118,14 +118,14 @@ impl QualifyCandidate<'_> {
118
118
match self {
119
119
QualifyCandidate :: QualifierStart ( segment, generics) => {
120
120
let generics = generics. as_ref ( ) . map_or_else ( String :: new, ToString :: to_string) ;
121
- replacer ( format ! ( "{}{ }::{}" , import , generics , segment ) ) ;
121
+ replacer ( format ! ( "{import}{generics }::{segment}" ) ) ;
122
122
}
123
123
QualifyCandidate :: UnqualifiedName ( generics) => {
124
124
let generics = generics. as_ref ( ) . map_or_else ( String :: new, ToString :: to_string) ;
125
- replacer ( format ! ( "{}{}" , import , generics ) ) ;
125
+ replacer ( format ! ( "{import}{generics}" ) ) ;
126
126
}
127
127
QualifyCandidate :: TraitAssocItem ( qualifier, segment) => {
128
- replacer ( format ! ( "<{} as {}>::{}" , qualifier , import , segment ) ) ;
128
+ replacer ( format ! ( "<{qualifier } as {import }>::{segment}" ) ) ;
129
129
}
130
130
QualifyCandidate :: TraitMethod ( db, mcall_expr) => {
131
131
Self :: qualify_trait_method ( db, mcall_expr, replacer, import, item) ;
@@ -155,16 +155,11 @@ impl QualifyCandidate<'_> {
155
155
hir:: Access :: Exclusive => make:: expr_ref ( receiver, true ) ,
156
156
hir:: Access :: Owned => receiver,
157
157
} ;
158
- replacer ( format ! (
159
- "{}::{}{}{}" ,
160
- import,
161
- method_name,
162
- generics,
163
- match arg_list {
164
- Some ( args) => make:: arg_list( iter:: once( receiver) . chain( args) ) ,
165
- None => make:: arg_list( iter:: once( receiver) ) ,
166
- }
167
- ) ) ;
158
+ let arg_list = match arg_list {
159
+ Some ( args) => make:: arg_list ( iter:: once ( receiver) . chain ( args) ) ,
160
+ None => make:: arg_list ( iter:: once ( receiver) ) ,
161
+ } ;
162
+ replacer ( format ! ( "{import}::{method_name}{generics}{arg_list}" ) ) ;
168
163
}
169
164
Some ( ( ) )
170
165
}
@@ -218,15 +213,17 @@ fn group_label(candidate: &ImportCandidate) -> GroupLabel {
218
213
}
219
214
}
220
215
. text ( ) ;
221
- GroupLabel ( format ! ( "Qualify {}" , name ) )
216
+ GroupLabel ( format ! ( "Qualify {name}" ) )
222
217
}
223
218
224
219
fn label ( candidate : & ImportCandidate , import : & LocatedImport ) -> String {
220
+ let import_path = & import. import_path ;
221
+
225
222
match candidate {
226
223
ImportCandidate :: Path ( candidate) if candidate. qualifier . is_none ( ) => {
227
- format ! ( "Qualify as `{}`" , import . import_path )
224
+ format ! ( "Qualify as `{import_path }`" )
228
225
}
229
- _ => format ! ( "Qualify with `{}`" , import . import_path ) ,
226
+ _ => format ! ( "Qualify with `{import_path }`" ) ,
230
227
}
231
228
}
232
229
0 commit comments