mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-10 23:24:29 +00:00
manual_map
This commit is contained in:
parent
60dda08266
commit
d8ad4afce8
3 changed files with 2 additions and 9 deletions
|
@ -182,7 +182,6 @@ get_first = "allow"
|
|||
if_same_then_else = "allow"
|
||||
large_enum_variant = "allow"
|
||||
let_and_return = "allow"
|
||||
manual_map = "allow"
|
||||
map_clone = "allow"
|
||||
match_like_matches_macro = "allow"
|
||||
match_single_binding = "allow"
|
||||
|
|
|
@ -410,11 +410,7 @@ impl ConstRef {
|
|||
lower_ctx: &LowerCtx<'_>,
|
||||
param: &ast::ConstParam,
|
||||
) -> Option<Self> {
|
||||
let default = param.default_val();
|
||||
match default {
|
||||
Some(_) => Some(Self::from_const_arg(lower_ctx, default)),
|
||||
None => None,
|
||||
}
|
||||
param.default_val().map(|default| Self::from_const_arg(lower_ctx, Some(default)))
|
||||
}
|
||||
|
||||
pub fn display<'a>(&'a self, db: &'a dyn ExpandDatabase) -> impl fmt::Display + 'a {
|
||||
|
|
|
@ -4285,10 +4285,8 @@ impl Type {
|
|||
// arg can be either a `Ty` or `constant`
|
||||
if let Some(ty) = arg.ty(Interner) {
|
||||
Some(format_smolstr!("{}", ty.display(db)))
|
||||
} else if let Some(const_) = arg.constant(Interner) {
|
||||
Some(format_smolstr!("{}", const_.display(db)))
|
||||
} else {
|
||||
None
|
||||
arg.constant(Interner).map(|const_| format_smolstr!("{}", const_.display(db)))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue