File tree Expand file tree Collapse file tree 3 files changed +6
-12
lines changed
rustfmt-core/rustfmt-lib/src Expand file tree Collapse file tree 3 files changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -281,9 +281,7 @@ impl<'a> FnSig<'a> {
281281 visit:: FnKind :: Method ( _, method_sig, vis, _) => {
282282 let mut fn_sig = FnSig :: from_method_sig ( method_sig, generics) ;
283283 fn_sig. defaultness = defaultness;
284- if let Some ( vis) = vis {
285- fn_sig. visibility = vis. clone ( ) ;
286- }
284+ fn_sig. visibility = vis. clone ( ) ;
287285 fn_sig
288286 }
289287 _ => unreachable ! ( ) ,
@@ -1753,7 +1751,7 @@ impl<'a> StaticParts<'a> {
17531751 ident : ii. ident ,
17541752 ty,
17551753 mutability : ast:: Mutability :: Not ,
1756- expr_opt : Some ( expr) ,
1754+ expr_opt : expr. as_ref ( ) ,
17571755 defaultness : Some ( ii. defaultness ) ,
17581756 span : ii. span ,
17591757 }
Original file line number Diff line number Diff line change @@ -191,8 +191,8 @@ impl Rewrite for Pat {
191191 infix. to_owned ( )
192192 } ;
193193 rewrite_pair (
194- & * * lhs,
195- & * * rhs,
194+ & lhs. unwrap ( ) ,
195+ & rhs. unwrap ( ) ,
196196 PairParts :: infix ( & infix) ,
197197 context,
198198 shape,
Original file line number Diff line number Diff line change 11use std:: iter:: ExactSizeIterator ;
22use std:: ops:: Deref ;
33
4- use rustc_span:: { BytePos , DUMMY_SP , Span , symbol:: kw} ;
4+ use rustc_span:: { BytePos , Span , symbol:: kw} ;
55use syntax:: ast:: { self , FunctionRetTy , Mutability } ;
66
77use crate :: config:: lists:: * ;
@@ -274,13 +274,9 @@ fn rewrite_segment(
274274 result. push_str ( & generics_str)
275275 }
276276 ast:: GenericArgs :: Parenthesized ( ref data) => {
277- let output = match data. output {
278- Some ( ref ty) => FunctionRetTy :: Ty ( ty. clone ( ) ) ,
279- None => FunctionRetTy :: Default ( DUMMY_SP ) ,
280- } ;
281277 result. push_str ( & format_function_type (
282278 data. inputs . iter ( ) . map ( |x| & * * x) ,
283- & output,
279+ & data . output ,
284280 false ,
285281 data. span ,
286282 context,
You can’t perform that action at this time.
0 commit comments