From 3fcffead4bfbdc3659d4278e2933253b6a363148 Mon Sep 17 00:00:00 2001 From: Max Murphy Date: Wed, 11 Sep 2024 18:24:41 +0200 Subject: [PATCH] Rust crate names are underscore in metadata --- src/dfx/src/lib/canister_info/rust.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dfx/src/lib/canister_info/rust.rs b/src/dfx/src/lib/canister_info/rust.rs index 82a9e753cc..0988e0ae4e 100644 --- a/src/dfx/src/lib/canister_info/rust.rs +++ b/src/dfx/src/lib/canister_info/rust.rs @@ -63,7 +63,8 @@ impl CanisterInfoFactory for RustCanisterInfo { (format!("crate `{package}`"), package.clone()) }; let mut candidate_targets = package_info.targets.iter().filter(|x| { - x.name == crate_name && x.crate_types.iter().any(|c| c == "cdylib" || c == "bin") + x.name == crate_name.replace("-", "_") + && x.crate_types.iter().any(|c| c == "cdylib" || c == "bin") }); let Some(target) = candidate_targets.next() else { if let Some(wrong_type_crate) =