我可以在git储存库中添加一个作为子目录的从属板条箱吗?

我可以在git储存库中添加一个作为子目录的从属板条箱吗?

问题描述:

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

I want to use an EDN parser but it is inside https://github.com/mozilla/mentat. https://github.com/mozilla/mentat/tree/master/edn has its own Cargo.toml.

我尝试过:

[dependencies]
edn = { git = "https://github.com/mozilla/mentat/tree/master/edn" }

但这是行不通的.

是否可以在mentat存储库中对此板条箱添加依赖项?

Is it possible to add dependency to this crate inside the mentat repository?

来自货物文档:

货物将在此位置获取git存储库,然后在git存储库内(不一定在根目录内)为请求的板条箱任意位置查找Cargo.toml.

Cargo will fetch the git repository at this location then look for a Cargo.toml for the requested crate anywhere inside the git repository (not necessarily at the root).

(强调我的)

这意味着您只能说:

[dependencies]
edn = { git = "https://github.com/mozilla/mentat" }