File tree 1 file changed +5
-5
lines changed
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(
181
181
let from = snippet_opt ( cx, self_ty. span ) ?;
182
182
let into = snippet_opt ( cx, target_ty. span ) ?;
183
183
184
- let return_type = matches ! ( sig. decl. output, FnRetTy :: Return ( _) )
185
- . then_some ( String :: from ( "Self" ) )
186
- . unwrap_or_default ( ) ;
187
184
let mut suggestions = vec ! [
188
185
// impl Into<T> for U -> impl From<T> for U
189
186
// ~~~~ ~~~~
@@ -200,10 +197,13 @@ fn convert_to_from(
200
197
// fn into([mut] self) -> T -> fn into([mut] v: T) -> T
201
198
// ~~~~ ~~~~
202
199
( self_ident. span, format!( "val: {from}" ) ) ,
200
+ ] ;
201
+
202
+ if let FnRetTy :: Return ( _) = sig. decl . output {
203
203
// fn into(self) -> T -> fn into(self) -> Self
204
204
// ~ ~~~~
205
- ( sig. decl. output. span( ) , return_type ) ,
206
- ] ;
205
+ suggestions . push ( ( sig. decl . output . span ( ) , String :: from ( "Self" ) ) ) ;
206
+ }
207
207
208
208
let mut finder = SelfFinder {
209
209
cx,
You can’t perform that action at this time.
0 commit comments