mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Use Symbol in Name
This commit is contained in:
parent
843806b79f
commit
3fe815b0f3
75 changed files with 750 additions and 755 deletions
|
@ -64,11 +64,7 @@ enum FieldOrTupleIdx {
|
|||
impl FieldOrTupleIdx {
|
||||
fn name(&self, db: &RootDatabase) -> String {
|
||||
match *self {
|
||||
FieldOrTupleIdx::Field(f) => f
|
||||
.name(db)
|
||||
.as_str()
|
||||
.map(|s| s.to_owned())
|
||||
.unwrap_or_else(|| format!(".{}", f.name(db).as_tuple_index().unwrap())),
|
||||
FieldOrTupleIdx::Field(f) => f.name(db).as_str().to_owned(),
|
||||
FieldOrTupleIdx::TupleIdx(i) => format!(".{i}"),
|
||||
}
|
||||
}
|
||||
|
@ -189,14 +185,7 @@ pub(crate) fn view_memory_layout(
|
|||
| Definition::SelfType(_) => "[ROOT]".to_owned(),
|
||||
|
||||
// def is an item
|
||||
def => def
|
||||
.name(db)
|
||||
.map(|n| {
|
||||
n.as_str()
|
||||
.map(|s| s.to_owned())
|
||||
.unwrap_or_else(|| format!(".{}", n.as_tuple_index().unwrap()))
|
||||
})
|
||||
.unwrap_or("[ROOT]".to_owned()),
|
||||
def => def.name(db).map(|n| n.as_str().to_owned()).unwrap_or("[ROOT]".to_owned()),
|
||||
};
|
||||
|
||||
let typename = ty.display(db).to_string();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue