learning-rust
learning-rust copied to clipboard
Q8: use add_one, not use add-one crate
在 /office/rust/book/more-about-cargo/ch14-03-cargo-workspaces.html
(link: https://doc.rust-lang.org/book/ch14-03-cargo-workspaces.html) 中提到:use add_one;
但是之前命名的是 add-one
,为什么引用的时候,是用下划线呢?
使用 use add-one
报错:
error: expected one of `::`, `;`, or `as`, found `-`
--> adder/src/main.rs:1:8
|
1 | use add-one;
| ^ expected one of `::`, `;`, or `as` here
这是为什么呀,我学到这里也有点儿疑惑,请问您搞清楚了吗
看文档:https://doc.rust-lang.org/book/ch14-03-cargo-workspaces.html
好像没有 add-one 了?