我正在尝试包含
Cargo.toml
文件中的第二个 toml 文件。Cargo.toml
:[package]
name = "toml"
authors = "TANDEX"
version = "0.0.0"
include = ["libs.toml"]
libs.toml
:[dependencies]
termion = "0.9.8"
还有这个:
Cargo.toml
:include = ["libs.toml"]
[package]
name = "toml"
authors = ["TANDEX"]
version = "0.0.0"
libs.toml
:[dependencies]
termion = "0.9.8"
据我所知,.toml 文件明确不能导入到其他 .toml 文件中。我在其他论坛上读到,这样做会违背 TOML 的理想,即尽可能简单化和简约。
我在网上搜索了大约 1 个小时后发现了这个,因为我也需要这个功能 u.u 。遗憾的是它不是其中的一部分。
此外,您还可以创建一个脚本,在指定的文件中附加所需的 .toml 数据,这将有效地添加内容,最终您将得到一个组合文件