File tree Expand file tree Collapse file tree 3 files changed +2
-9
lines changed Expand file tree Collapse file tree 3 files changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -182,7 +182,6 @@ get_first = "allow"
182
182
if_same_then_else = " allow"
183
183
large_enum_variant = " allow"
184
184
let_and_return = " allow"
185
- manual_map = " allow"
186
185
map_clone = " allow"
187
186
match_like_matches_macro = " allow"
188
187
match_single_binding = " allow"
Original file line number Diff line number Diff line change @@ -410,11 +410,7 @@ impl ConstRef {
410
410
lower_ctx : & LowerCtx < ' _ > ,
411
411
param : & ast:: ConstParam ,
412
412
) -> Option < Self > {
413
- let default = param. default_val ( ) ;
414
- match default {
415
- Some ( _) => Some ( Self :: from_const_arg ( lower_ctx, default) ) ,
416
- None => None ,
417
- }
413
+ param. default_val ( ) . map ( |default| Self :: from_const_arg ( lower_ctx, Some ( default) ) )
418
414
}
419
415
420
416
pub fn display < ' a > ( & ' a self , db : & ' a dyn ExpandDatabase ) -> impl fmt:: Display + ' a {
Original file line number Diff line number Diff line change @@ -4285,10 +4285,8 @@ impl Type {
4285
4285
// arg can be either a `Ty` or `constant`
4286
4286
if let Some ( ty) = arg. ty ( Interner ) {
4287
4287
Some ( format_smolstr ! ( "{}" , ty. display( db) ) )
4288
- } else if let Some ( const_) = arg. constant ( Interner ) {
4289
- Some ( format_smolstr ! ( "{}" , const_. display( db) ) )
4290
4288
} else {
4291
- None
4289
+ arg . constant ( Interner ) . map ( |const_| format_smolstr ! ( "{}" , const_ . display ( db ) ) )
4292
4290
}
4293
4291
} )
4294
4292
}
You can’t perform that action at this time.
0 commit comments