From 5581148d602dd581c701b814cc779c4f3615b85c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 24 Sep 2024 18:18:27 +0900 Subject: [PATCH] chore: Fix graph creation of `cargo bump` --- tools/swc-releaser/src/main.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/swc-releaser/src/main.rs b/tools/swc-releaser/src/main.rs index 8dfc97878cb..397799f4714 100644 --- a/tools/swc-releaser/src/main.rs +++ b/tools/swc-releaser/src/main.rs @@ -281,10 +281,11 @@ struct InternedGraph { impl InternedGraph { fn add_node(&mut self, name: String) -> usize { - let id = self.ix.len(); - self.ix.insert(name); - self.g.add_node(id); - id + self.ix.get_index_of(&name).unwrap_or_else(|| { + let ix = self.ix.len(); + self.ix.insert_full(name); + ix + }) as _ } fn node(&self, name: &str) -> usize { @@ -300,6 +301,7 @@ fn get_data() -> Result<(VersionMap, InternedGraph)> { let workspace_packages = md .workspace_packages() .into_iter() + .filter(|p| p.publish != Some(vec![])) .map(|p| p.name.clone()) .collect::>(); let mut graph = InternedGraph::default();