diff --git a/src/assets/RustAsset.js b/src/assets/RustAsset.js index 647e6b0cb42..f66d3a4fe71 100644 --- a/src/assets/RustAsset.js +++ b/src/assets/RustAsset.js @@ -153,7 +153,9 @@ class RustAsset extends Asset { // Get output file paths let outDir = path.join(cargoDir, 'target', RUST_TARGET, 'release'); - let rustName = cargoConfig.package.name; + + // Rust converts '-' to '_' when outputting files. + let rustName = cargoConfig.package.name.replace(/-/g, '_'); this.wasmPath = path.join(outDir, rustName + '.wasm'); this.depsPath = path.join(outDir, rustName + '.d'); } diff --git a/test/integration/rust-cargo/Cargo.toml b/test/integration/rust-cargo/Cargo.toml index 49f0c68271c..a567d9c7077 100644 --- a/test/integration/rust-cargo/Cargo.toml +++ b/test/integration/rust-cargo/Cargo.toml @@ -1,9 +1,9 @@ [package] -name = "cargo" +name = "cargo-test" version = "0.1.0" authors = ["josealbizures "] [dependencies] [lib] -crate-type = ["cdylib"] \ No newline at end of file +crate-type = ["cdylib"]