File tree 3 files changed +5
-5
lines changed
3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ impl LateLintPass for NeedlessBool {
59
59
} ;
60
60
61
61
let hint = if ret {
62
- format ! ( "return {}; " , snip)
62
+ format ! ( "return {}" , snip)
63
63
} else {
64
64
snip. to_string ( )
65
65
} ;
Original file line number Diff line number Diff line change @@ -95,9 +95,9 @@ impl LateLintPass for Transmute {
95
95
|db| {
96
96
if let Some ( arg) = sugg:: Sugg :: hir_opt ( cx, & * args[ 0 ] ) {
97
97
let sugg = if ptr_ty == rty {
98
- arg. as_ty ( & to_ty. to_string ( ) )
98
+ arg. as_ty ( to_ty)
99
99
} else {
100
- arg. as_ty ( & format ! ( "{} as {}" , cx. tcx. mk_ptr( rty) , to_ty ) )
100
+ arg. as_ty ( cx. tcx . mk_ptr ( rty) ) . as_ty ( to_ty )
101
101
} ;
102
102
103
103
db. span_suggestion ( e. span , "try" , sugg. to_string ( ) ) ;
Original file line number Diff line number Diff line change @@ -126,8 +126,8 @@ impl<'a> Sugg<'a> {
126
126
}
127
127
128
128
/// Convenience method to create the `<lhs> as <rhs>` suggestion.
129
- pub fn as_ty ( self , rhs : & str ) -> Sugg < ' static > {
130
- make_assoc ( AssocOp :: As , & self , & Sugg :: NonParen ( rhs. into ( ) ) )
129
+ pub fn as_ty < R : std :: fmt :: Display > ( self , rhs : R ) -> Sugg < ' static > {
130
+ make_assoc ( AssocOp :: As , & self , & Sugg :: NonParen ( rhs. to_string ( ) . into ( ) ) )
131
131
}
132
132
133
133
/// Convenience method to create the `&<expr>` suggestion.
You can’t perform that action at this time.
0 commit comments