Skip to content

Commit 2261e4e

Browse files
authored
Merge pull request #19522 from davidbarsky/davidbarsky/fix-panic-in-view-crate-graph
internal: fix panic in `view_crate_graph`
2 parents 8b6621a + 069de21 commit 2261e4e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crates/ide/src/view_crate_graph.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use dot::{Id, LabelText};
2+
use ide_db::base_db::salsa::plumbing::AsId;
23
use ide_db::{
34
FxHashMap, RootDatabase,
45
base_db::{
@@ -78,7 +79,8 @@ impl<'a> dot::Labeller<'a, Crate, Edge<'a>> for DotCrateGraph<'_> {
7879
}
7980

8081
fn node_id(&'a self, n: &Crate) -> Id<'a> {
81-
Id::new(format!("_{:?}", n)).unwrap()
82+
let id = n.as_id().as_u32();
83+
Id::new(format!("_{:?}", id)).unwrap()
8284
}
8385

8486
fn node_shape(&'a self, _node: &Crate) -> Option<LabelText<'a>> {

0 commit comments

Comments
 (0)