chore: Fix graph creation of cargo bump

This commit is contained in:
강동윤 (Donny) 2024-09-24 18:18:27 +09:00
parent 14cfd70ee0
commit 5581148d60

View File

@ -281,10 +281,11 @@ struct InternedGraph {
impl InternedGraph { impl InternedGraph {
fn add_node(&mut self, name: String) -> usize { fn add_node(&mut self, name: String) -> usize {
let id = self.ix.len(); self.ix.get_index_of(&name).unwrap_or_else(|| {
self.ix.insert(name); let ix = self.ix.len();
self.g.add_node(id); self.ix.insert_full(name);
id ix
}) as _
} }
fn node(&self, name: &str) -> usize { fn node(&self, name: &str) -> usize {
@ -300,6 +301,7 @@ fn get_data() -> Result<(VersionMap, InternedGraph)> {
let workspace_packages = md let workspace_packages = md
.workspace_packages() .workspace_packages()
.into_iter() .into_iter()
.filter(|p| p.publish != Some(vec![]))
.map(|p| p.name.clone()) .map(|p| p.name.clone())
.collect::<Vec<_>>(); .collect::<Vec<_>>();
let mut graph = InternedGraph::default(); let mut graph = InternedGraph::default();