作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我遇到了这个错误:
error: failed to parse manifest at `...\Cargo.toml`
Caused by:
Feature `client` depends on `rusttls` which is not an optional dependency.
Consider adding `optional = true` to the dependency
如果我添加 optional = true
,它就会消失,但出于安全原因,我不希望 rusttls 是可选的。
此错误的确切原因是什么?除了将其设为可选之外,可能的解决方案是什么?
我的 Cargo.toml 有这个:
[features]
default = ["client", "server"]
client = ["serde_json", "serde-xml-rs", "serde_ignored", "hyper", "hyper-tls", "rusttls", "tokio-core", "url", "uuid", "multipart"]
server = ["serde_json", "serde-xml-rs", "serde_ignored", "hyper", "hyper-tls", "rusttls", "tokio-core", "tokio-proto", "tokio-tls", "regex", "percent-encoding", "url", "uuid", "multipart"]
从我在 Rust 书中读到的,这样做应该意味着默认情况下客户端和服务器具有这些依赖关系,对吧?
最佳答案
如果依赖项是可选的,您应该只在功能列表中包含该依赖项。如果依赖项不是可选的,则仅将其包含在 [dependencies]
部分中。
关于rust - 功能 'xxx' 依赖于 'yyy' 这不是可选的依赖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58485723/
我正在尝试用 Swift 编写这段 JavaScript 代码:k_combinations 到目前为止,我在 Swift 中有这个: import Foundation import Cocoa e
我是一名优秀的程序员,十分优秀!