How do I tell Cargo to build files other than main.rs?

后端 未结 3 932
不知归路
不知归路 2020-12-15 06:36

Here is my directory structure:

lowks@lowkster ~/src/rustlang/gettingrusty $ tree .
.
├── Cargo.lock
├── Cargo.toml
├── foo.txt
├── src
│   ├── boolean_examp         


        
3条回答
  •  清歌不尽
    2020-12-15 07:10

    Put other.rs file into bin subfolder of src folder (./src/bin/other.rs). And run cargo build --bin other or cargo run --bin other

提交回复
热议问题