diff --git a/src/dfx/src/lib/canister_info/rust.rs b/src/dfx/src/lib/canister_info/rust.rs index a3b7266c26..22ce219e04 100644 --- a/src/dfx/src/lib/canister_info/rust.rs +++ b/src/dfx/src/lib/canister_info/rust.rs @@ -64,7 +64,7 @@ impl CanisterInfoFactory for RustCanisterInfo { }; let mut candidate_targets = package_info.targets.iter().filter(|x| { x.crate_types.iter().any(|c| { - (c == "cdylib" && x.name == crate_name.replace('-', "_")) + (c == "cdylib" && x.name.replace('-', "_") == crate_name.replace('-', "_")) || (c == "bin" && x.name == crate_name) }) });