mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
Cleaned up code
This commit is contained in:
parent
e28046c673
commit
b63234e20b
4 changed files with 14 additions and 16 deletions
|
@ -349,11 +349,10 @@ pub(super) fn definition(
|
|||
Definition::Function(it) => label_and_docs(db, it),
|
||||
Definition::Adt(it) => label_and_docs(db, it),
|
||||
Definition::Variant(it) => label_value_and_docs(db, it, |&it| {
|
||||
let hir_db: &dyn HirDatabase = db;
|
||||
let body = hir_db.const_eval_variant(it.into());
|
||||
let body = it.eval(db);
|
||||
match body {
|
||||
Ok(x) => Some(format!("{}", x)),
|
||||
Err(_) => it.value(db).map(|s| format!("{}", s)),
|
||||
Err(_) => it.value(db).map(|x| format!("{}", x)),
|
||||
}
|
||||
}),
|
||||
Definition::Const(it) => label_value_and_docs(db, it, |it| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue