mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 11:31:15 +00:00
internal: fix panic in view_crate_graph
This commit is contained in:
parent
6ca780700d
commit
069de21793
@ -1,4 +1,5 @@
|
|||||||
use dot::{Id, LabelText};
|
use dot::{Id, LabelText};
|
||||||
|
use ide_db::base_db::salsa::plumbing::AsId;
|
||||||
use ide_db::{
|
use ide_db::{
|
||||||
FxHashMap, RootDatabase,
|
FxHashMap, RootDatabase,
|
||||||
base_db::{
|
base_db::{
|
||||||
@ -78,7 +79,8 @@ impl<'a> dot::Labeller<'a, Crate, Edge<'a>> for DotCrateGraph<'_> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn node_id(&'a self, n: &Crate) -> Id<'a> {
|
fn node_id(&'a self, n: &Crate) -> Id<'a> {
|
||||||
Id::new(format!("_{:?}", n)).unwrap()
|
let id = n.as_id().as_u32();
|
||||||
|
Id::new(format!("_{:?}", id)).unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn node_shape(&'a self, _node: &Crate) -> Option<LabelText<'a>> {
|
fn node_shape(&'a self, _node: &Crate) -> Option<LabelText<'a>> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user