File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed
Expand file tree Collapse file tree 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 {
5959 } ;
6060
6161 let hint = if ret {
62- format ! ( "return {}; " , snip)
62+ format ! ( "return {}" , snip)
6363 } else {
6464 snip. to_string ( )
6565 } ;
Original file line number Diff line number Diff line change @@ -95,9 +95,9 @@ impl LateLintPass for Transmute {
9595 |db| {
9696 if let Some ( arg) = sugg:: Sugg :: hir_opt ( cx, & * args[ 0 ] ) {
9797 let sugg = if ptr_ty == rty {
98- arg. as_ty ( & to_ty. to_string ( ) )
98+ arg. as_ty ( to_ty)
9999 } 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 )
101101 } ;
102102
103103 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> {
126126 }
127127
128128 /// 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 ( ) ) )
131131 }
132132
133133 /// Convenience method to create the `&<expr>` suggestion.
You can’t perform that action at this time.
0 commit comments