我想为 Rust 创建一个库。这是我项目的 Cargo.toml 文件:
[package]
name = "binary_tree"
version = "0.0.1"
authors = ["Guillaume Bersac <bersac_1@hotmail.fr>"]
[lib]
test = true
plugin = false
这是我存储库的文件:
Cargo.toml
README.md
src
|_node.rs
当我运行命令“cargo run”或“cargo build”或“cargo test”时,我收到以下错误消息:
Cargo.toml is not a valid manifest
expected a value of type
array
, but found a value of typetable
for the keylib
如何格式化我的 Cargo.toml 以使其正确编译?
最佳答案
你运行的是最新的 rustc
和 cargo
吗?如果没有,我认为您过去需要 [[lib]]
,它在 TOML 中创建一个表数组。
关于rust - 用于 lib 的 Cargo.toml,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26434053/