Currently cargo infers binaries from files in src/bin. This works if you binary fits in one file, but if you need more than one file, you have to write custom [[bin]] specification in Cargo.toml.
Looks like a reasonable convention for multifile binary projects is this:
src/
bin/
server/
main.rs
aux.rs
client/
main.rs
foo.rs
So let's infer src/bin/foo/main.rs as a binary named foo?
This should be mostly backwards compatible change. The only failure case is when someone has src/bin/foo/main.rs which is not a binary, and no [[bin]] sections are present, and this seems unlikely.
A potential edge case is
src/
bin/
foo.rs
foo/
main.rs
This should be an error.
Currently
cargoinfers binaries from files insrc/bin. This works if you binary fits in one file, but if you need more than one file, you have to write custom[[bin]]specification in Cargo.toml.Looks like a reasonable convention for multifile binary projects is this:
So let's infer
src/bin/foo/main.rsas a binary namedfoo?This should be mostly backwards compatible change. The only failure case is when someone has
src/bin/foo/main.rswhich is not a binary, and no[[bin]]sections are present, and this seems unlikely.A potential edge case is
This should be an error.