我正在用 cargo 写图书馆。如果此库依赖于另一个库(例如 libc
),该库公开了一个功能(在本例中为use_std
),那么如何使我公开的功能在我的依赖项中启用或禁用该功能?
查看cargo documentation,似乎没有指定官方方法来执行此操作。
最佳答案
从the documentation you linked to:
# 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"]
够了吗?
关于rust - 如何在Cargo中为附属关系 'pass down'功能标记?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63419372/