Skip to content

Commit

Permalink
Fix clippy & test
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-mysten committed Feb 27, 2025
1 parent 3a5103b commit 4dca648
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
2 changes: 1 addition & 1 deletion crates/sui-move-build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ impl CompiledPackage {
.clone()
.published
.into_iter()
.filter(|(pkg_name, _)| pkgs_to_keep.contains(&pkg_name))
.filter(|(pkg_name, _)| pkgs_to_keep.contains(pkg_name))
.collect())
}
}
Expand Down
15 changes: 3 additions & 12 deletions crates/sui/src/client_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1780,7 +1780,7 @@ async fn compile_package_simple(
let resolution_graph = config.resolution_graph(package_path, chain_id.clone())?;
let mut compiled_package =
build_from_resolution_graph(resolution_graph, false, false, chain_id)?;
pkg_tree_shake(&client, false, &mut compiled_package).await?;
pkg_tree_shake(client, false, &mut compiled_package).await?;

Ok(compiled_package)
}
Expand All @@ -1803,12 +1803,7 @@ pub(crate) async fn upgrade_package(
)
.await?;

pkg_tree_shake(
&client,
with_unpublished_dependencies,
&mut compiled_package,
)
.await?;
pkg_tree_shake(client, with_unpublished_dependencies, &mut compiled_package).await?;

compiled_package.published_at.as_ref().map_err(|e| match e {
PublishedAtError::NotPresent => {
Expand Down Expand Up @@ -3144,11 +3139,7 @@ async fn pkg_tree_shake(
compiled_package: &mut CompiledPackage,
) -> Result<(), anyhow::Error> {
let pkgs = compiled_package.find_immediate_deps_pkgs_to_keep(with_unpublished_dependencies)?;
let pkg_ids = pkgs
.clone()
.into_iter()
.map(|(_, id)| id)
.collect::<Vec<_>>();
let pkg_ids: Vec<_> = pkgs.clone().into_values().collect();

let pkg_name_to_orig_id: BTreeMap<_, _> = compiled_package
.package
Expand Down
2 changes: 1 addition & 1 deletion crates/sui/tests/cli_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1879,7 +1879,7 @@ async fn test_package_publish_nonexistent_dependency() -> Result<(), anyhow::Err

let err = result.unwrap_err().to_string();
assert!(
err.contains("Dependency object does not exist or was deleted"),
err.contains("Object 0x0000000000000000000000000000000000000000000000000000000000abc123 does not exist"),
"{}",
err
);
Expand Down

0 comments on commit 4dca648

Please sign in to comment.