说我有一个项目:
foo-bar
| - lib.rs
| - ....
Run Code Online (Sandbox Code Playgroud)
但我不想要命名空间foo-bar,我只想要bar. 无论如何要在中指定这个lib.rs?显而易见的解决方案是重命名foo-bar为bar,但在这种情况下我不能这样做。
您可以在 中指定库的名称Cargo.toml,请参阅Cargo 文档。
[lib]
# The name of a target is the name of the library that will be generated. This
# is defaulted to the name of the package or project.
name = "foo"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
127 次 |
| 最近记录: |