Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/view_memory_layout.rs')
-rw-r--r--crates/ide/src/view_memory_layout.rs15
1 files changed, 2 insertions, 13 deletions
diff --git a/crates/ide/src/view_memory_layout.rs b/crates/ide/src/view_memory_layout.rs
index 826447d058..ad99c2162c 100644
--- a/crates/ide/src/view_memory_layout.rs
+++ b/crates/ide/src/view_memory_layout.rs
@@ -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();