Cargo run我正在按照《The Rust 编程语言》一书中的说明构建一个猜谜游戏,但是每当我尝试在 VSCodium(VSCode 的开源版本)终端中运行我的代码(通过命令)时,我的代码都拒绝运行运行时出现以下错误:
no targets specified in the manifest
either src/lib.rs, src/main.rs, a [lib] section, or [[bin]] section must be present
Run Code Online (Sandbox Code Playgroud)
我的 Cargo.toml 文件如下所示:
[package]
name = "GuessingGame"
path = "src/GuessingGame.rs"
version = "0.1.0"
edition = "2021"
authors = ["my name <example@example.com>"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
Run Code Online (Sandbox Code Playgroud)
版本:VSCodium:1.73.1 操作系统:Zorin OS 16.2
我尝试更改[package]为[[bin]]and [lib],但它给了我更多错误,是:
this virtual manifest specifies a [lib] section, which is not allowed
and
this …