Skip to content

Commit d8ad4af

Browse files
committed
manual_map
1 parent 60dda08 commit d8ad4af

File tree

3 files changed

+2
-9
lines changed

3 files changed

+2
-9
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ get_first = "allow"
182182
if_same_then_else = "allow"
183183
large_enum_variant = "allow"
184184
let_and_return = "allow"
185-
manual_map = "allow"
186185
map_clone = "allow"
187186
match_like_matches_macro = "allow"
188187
match_single_binding = "allow"

crates/hir-def/src/hir/type_ref.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -410,11 +410,7 @@ impl ConstRef {
410410
lower_ctx: &LowerCtx<'_>,
411411
param: &ast::ConstParam,
412412
) -> 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)))
418414
}
419415

420416
pub fn display<'a>(&'a self, db: &'a dyn ExpandDatabase) -> impl fmt::Display + 'a {

crates/hir/src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4285,10 +4285,8 @@ impl Type {
42854285
// arg can be either a `Ty` or `constant`
42864286
if let Some(ty) = arg.ty(Interner) {
42874287
Some(format_smolstr!("{}", ty.display(db)))
4288-
} else if let Some(const_) = arg.constant(Interner) {
4289-
Some(format_smolstr!("{}", const_.display(db)))
42904288
} else {
4291-
None
4289+
arg.constant(Interner).map(|const_| format_smolstr!("{}", const_.display(db)))
42924290
}
42934291
})
42944292
}

0 commit comments

Comments
 (0)