mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +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"
|
if_same_then_else = "allow"
|
||||||
large_enum_variant = "allow"
|
large_enum_variant = "allow"
|
||||||
let_and_return = "allow"
|
let_and_return = "allow"
|
||||||
manual_map = "allow"
|
|
||||||
map_clone = "allow"
|
map_clone = "allow"
|
||||||
match_like_matches_macro = "allow"
|
match_like_matches_macro = "allow"
|
||||||
match_single_binding = "allow"
|
match_single_binding = "allow"
|
||||||
|
|
|
@ -410,11 +410,7 @@ impl ConstRef {
|
||||||
lower_ctx: &LowerCtx<'_>,
|
lower_ctx: &LowerCtx<'_>,
|
||||||
param: &ast::ConstParam,
|
param: &ast::ConstParam,
|
||||||
) -> Option<Self> {
|
) -> Option<Self> {
|
||||||
let default = param.default_val();
|
param.default_val().map(|default| Self::from_const_arg(lower_ctx, Some(default)))
|
||||||
match default {
|
|
||||||
Some(_) => Some(Self::from_const_arg(lower_ctx, default)),
|
|
||||||
None => None,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn display<'a>(&'a self, db: &'a dyn ExpandDatabase) -> impl fmt::Display + 'a {
|
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`
|
// arg can be either a `Ty` or `constant`
|
||||||
if let Some(ty) = arg.ty(Interner) {
|
if let Some(ty) = arg.ty(Interner) {
|
||||||
Some(format_smolstr!("{}", ty.display(db)))
|
Some(format_smolstr!("{}", ty.display(db)))
|
||||||
} else if let Some(const_) = arg.constant(Interner) {
|
|
||||||
Some(format_smolstr!("{}", const_.display(db)))
|
|
||||||
} else {
|
} else {
|
||||||
None
|
arg.constant(Interner).map(|const_| format_smolstr!("{}", const_.display(db)))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue