【发布时间】:2022-08-02 23:56:04
【问题描述】:
在通过Rust by Example时, 我发现自己为教程中的每个程序创建了一个新的货物项目。
这很快变得很麻烦。
我尝试的另一个策略是让我的工作目录结构如下:
src\\
guessing_game.rs
main.rs
temp.rs
其中main.rs 包含
mod guessing_game;
mod temp;
/// Hello
fn main() {
// guessing_game::play();
println!(\"{}\", temp::is_prime(6));
}
和cargo.toml 包含
[package]
name = \"rust_prog_dump\"
version = \"0.1.0\"
edition = \"2018\"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
rand = \"0.8.4\"
我会在main() 中调用目标函数并注释掉其他函数。
我们有替代方案吗?
我见过this issue 和Jon Cairns\' post。 我使用 Windows,因此该脚本对我不起作用。
标签: rust