Is there a way to specify custom main.rs/lib.rs for Rust app development?

Viewed 37

Perhaps use foo.rs/bar.rs instead of the default main/lib package root file?

How to config it?

1 Answers

For a library, set [lib].path:

[lib]
path = "src/bar.rs"

For a binary, set [[bin]].path:

[[bin]]
name = "foo"
path = "src/foo.rs"
Related