antoniusnaumann / cargo-swift

A cargo plugin to easily build Swift packages from Rust code
https://crates.io/crates/cargo-swift
Apache License 2.0
180 stars 22 forks source link

fix: lib_name should replace hyphens #41

Closed flisky closed 11 months ago

flisky commented 11 months ago

cargo has a special flag to replace hyphens with underscores for output's name, which is always true for non-binary crate type.

uplift_filename image

crate_name image

antoniusnaumann commented 11 months ago

So this implies we can always use the name with _?

antoniusnaumann commented 11 months ago

If you got time, please resolve the conflicts to main and the clippy lint @flisky :)

let crate_name = lib.name.replace("-", "_");
                                       ^^^ help: try using a `char` instead: `'-'`

Thank you for your contribution!

flisky commented 11 months ago

Updated, thank you!