Merge pull request #19522 from davidbarsky/davidbarsky/fix-panic-in-view-crate-graph

internal: fix panic in `view_crate_graph`
This commit is contained in:
Lukas Wirth 2025-04-04 16:00:18 +00:00 committed by GitHub
commit 099d0e09cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,4 +1,5 @@
use dot::{Id, LabelText};
use ide_db::base_db::salsa::plumbing::AsId;
use ide_db::{
FxHashMap, RootDatabase,
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> {
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>> {