Application crates

What steps are needed to create an installable application crate? (I.e. one that can be installed using cargo install <crate>).

Should it work if the crate has only a src/main.rs, or does one need to add a [[bin]] section?

(I have a vague memory if having tried it and ran into an error which hinted that cargo needed me to do something specific to binary targets but I didn't understand what -- but it was so long ago that I don't remember the details).

Any binary (executable) crate will work with cargo install. Just having a src/main.rs should be sufficient.

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.