我正在 Cargo 中编写一个库。如果这个库依赖于另一个库,例如libc http://crates.io/crates/libc,它公开了一个功能(在本例中,use_std
),如何使我公开的功能在我的依赖项中启用或禁用该功能?
看着货物文件 http://doc.crates.io/manifest.html#the-features-section,看起来没有指定官方方法来执行此操作。
From 您链接到的文档 https://doc.rust-lang.org/cargo/reference/manifest.html#the-features-section:
# Features can be used to reexport features of other packages. The `session`
# feature of package `awesome` will ensure that the `session` feature of the
# package `cookie` is also enabled.
session = ["cookie/session"]
这样就足够了吗?
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)