Note: This site is currently "Under construction". I'm migrating to a new version of my site building software. Lots of things are in a state of disrepair as a result (for example, footnote links aren't working). It's all part of the process of building in public. Most things should still be readable though.

Change The Name Of A Rust Binary So It's Different From The Package Name

By default, the name of a rust binary is the same as the package name (which I think comes from the directory name). I'm changing the name by adding this to my _Cargo.toml__ file:

Code

[[bin]]
name = "new-name"
path = "src/main.rs"