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.rs | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/crates/ide/src/view_memory_layout.rs b/crates/ide/src/view_memory_layout.rs index 3b1b4968e7..9ed0d3f224 100644 --- a/crates/ide/src/view_memory_layout.rs +++ b/crates/ide/src/view_memory_layout.rs @@ -145,26 +145,28 @@ pub(crate) fn view_memory_layout( } } - ty.layout(db).map(|layout| { - let item_name = match def { - Definition::Local(l) => l.name(db).as_str().unwrap().to_owned(), - _ => "[ROOT]".to_owned(), - }; - - let typename = ty.display(db).to_string(); - - let mut nodes = vec![MemoryLayoutNode { - item_name, - typename: typename.clone(), - size: layout.size(), - offset: 0, - alignment: layout.align(), - parent_idx: -1, - children_start: -1, - children_len: 0, - }]; - read_layout(&mut nodes, db, &ty, &layout, 0); - - RecursiveMemoryLayout { nodes } - }) + ty.layout(db) + .map(|layout| { + let item_name = match def { + Definition::Local(l) => l.name(db).as_str().unwrap().to_owned(), + _ => "[ROOT]".to_owned(), + }; + + let typename = ty.display(db).to_string(); + + let mut nodes = vec![MemoryLayoutNode { + item_name, + typename: typename.clone(), + size: layout.size(), + offset: 0, + alignment: layout.align(), + parent_idx: -1, + children_start: -1, + children_len: 0, + }]; + read_layout(&mut nodes, db, &ty, &layout, 0); + + RecursiveMemoryLayout { nodes } + }) + .ok() } |