我编写 Cargo.toml 的依赖项:
[dependencies ]
opencv = {version = "0.26", default-features = false, features = ["opencv-41"]}
以上一行可以通过编译。
我想为依赖项分开行。
本页 https://github.com/BurntSushi/toml-test/blob/master/tests/valid/multiline-string.toml
说解决办法。
我参考这个解决方案来编写我的依赖项:
[dependencies ]
opencv = """\{version = "0.26", \
default-features = false, \
features = ["opencv-41"] \
}"""
但是编译器抛出错误:
$ cargo build [±master ●]
error: failed to parse manifest at /home/curlywei/WorkSpace/rust/testcargo/Cargo.toml
Caused by:
failed to parse the version requirement { version = "0.26", default-features = false, features = ["opencv-41"] } for dependency opencv
Caused by:
the given version requirement is invalid
我该怎么办?