We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 285ef8b commit 4aa82d4Copy full SHA for 4aa82d4
1 file changed
12-ownership-system/12-01-ownership.md
@@ -263,6 +263,7 @@ fn main() {
263
>结果: x=100, y=102
264
265
注意: 例子1是比较特别的,使不使用 move 对结果都没什么影响,因为环境变量 x 是 i32 类型,属于 primitive type,实现了 Copy trait,在闭包使用 move 的时候,是先 clone 了一份 x ,在 move 的时候是 move 了这份 clone 的 x,所以后面的 println!引用 x 的时候没有报错。
266
+
267
**例子2:**
268
```rust
269
fn main() {
0 commit comments