mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 11:59:49 +00:00
fix incorrect committed rust and run prettier
This commit is contained in:
parent
cfa15d49aa
commit
de5e3cf745
4 changed files with 37 additions and 36 deletions
|
@ -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(),
|
||||
};
|
||||
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 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);
|
||||
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 }
|
||||
})
|
||||
RecursiveMemoryLayout { nodes }
|
||||
})
|
||||
.ok()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue