Skip to content

Commit 4aa82d4

Browse files
author
Naupio Z.Y. Huang
committed
update 12-01 && rewrite 04 chapter: add 04-00-rust-travel (#167)
* fix #160 * rewrite 04 chapter: add 04-00-rust-travel * fix #163 * update 12-01
1 parent 285ef8b commit 4aa82d4

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

12-ownership-system/12-01-ownership.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ fn main() {
263263
>结果: x=100, y=102
264264
265265
注意: 例子1是比较特别的,使不使用 move 对结果都没什么影响,因为环境变量 x 是 i32 类型,属于 primitive type,实现了 Copy trait,在闭包使用 move 的时候,是先 clone 了一份 x ,在 move 的时候是 move 了这份 clone 的 x,所以后面的 println!引用 x 的时候没有报错。
266+
266267
**例子2:**
267268
```rust
268269
fn main() {

0 commit comments

Comments
 (0)