Skip to content

Commit aeef7fb

Browse files
authored
"extern crate" is no longer necessary in rust 2018
1 parent e5443f8 commit aeef7fb

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/advance/macro.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ hello_macro_derive = { path = "../hello_macro/hello_macro_derive" }
335335

336336
此时,`hello_macro` 项目就可以成功的引用到 `hello_macro_derive` 本地包了,对于项目依赖引入的详细介绍,可以参见 [Cargo 章节](https://course.rs/cargo/dependency.html)
337337

338-
另外,学习过程更好的办法是通过展开宏来阅读和调试自己写的宏,这里需要用到一个 cargo-expand 的工具,可以通过下面的命令安装
338+
另外,学习过程宏更好的办法是通过展开宏来阅读和调试自己写的宏,这里需要用到一个 cargo-expand 的工具,可以通过下面的命令安装
339339
```bash
340340
cargo install cargo-expand
341341
```
@@ -360,8 +360,6 @@ quote = "1.0"
360360
其次,在 `hello_macro_derive/src/lib.rs` 中添加如下代码:
361361

362362
```rust
363-
extern crate proc_macro;
364-
365363
use proc_macro::TokenStream;
366364
use quote::quote;
367365
use syn;

0 commit comments

Comments
 (0)