我可以添加一个git存储库中子目录的依赖包吗?

Vee*_*mas 3 git rust rust-cargo

我想使用EDN解析器,但它位于https://github.com/mozilla/mentat中.https://github.com/mozilla/mentat/tree/master/edn有自己的Cargo.toml.

我试过这个:

[dependencies]
edn = { git = "https://github.com/mozilla/mentat/tree/master/edn" }
Run Code Online (Sandbox Code Playgroud)

但它不起作用.

是否可以在mentat存储库中向此包添加依赖项?

Luk*_*odt 7

货物文件:

Cargo将在此位置获取git存储库,然后在git存储库内的任何位置查找Cargo.toml请求的包(不一定在根位置).

(强调我的)

这意味着你可以说:

[dependencies]
edn = { git = "https://github.com/mozilla/mentat" }
Run Code Online (Sandbox Code Playgroud)