File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -181,9 +181,6 @@ fn convert_to_from(
181181 let from = self_ty. span . get_source_text ( cx) ?;
182182 let into = target_ty. span . get_source_text ( cx) ?;
183183
184- let return_type = matches ! ( sig. decl. output, FnRetTy :: Return ( _) )
185- . then_some ( String :: from ( "Self" ) )
186- . unwrap_or_default ( ) ;
187184 let mut suggestions = vec ! [
188185 // impl Into<T> for U -> impl From<T> for U
189186 // ~~~~ ~~~~
@@ -200,10 +197,13 @@ fn convert_to_from(
200197 // fn into([mut] self) -> T -> fn into([mut] v: T) -> T
201198 // ~~~~ ~~~~
202199 ( self_ident. span, format!( "val: {from}" ) ) ,
200+ ] ;
201+
202+ if let FnRetTy :: Return ( _) = sig. decl . output {
203203 // fn into(self) -> T -> fn into(self) -> Self
204204 // ~ ~~~~
205- ( sig. decl. output. span( ) , return_type ) ,
206- ] ;
205+ suggestions . push ( ( sig. decl . output . span ( ) , String :: from ( "Self" ) ) ) ;
206+ }
207207
208208 let mut finder = SelfFinder {
209209 cx,
You can’t perform that action at this time.
0 commit comments