We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 691eb75 + 66ec74e commit 426f700Copy full SHA for 426f700
1 file changed
12-ownership-system/12-01-ownership.md
@@ -61,7 +61,7 @@ b.rs:3 println!("{}", a);
61
先看如下代码:
62
```rust
63
{
64
- let a: String = String::new("xyz");
+ let a: String = String::from("xyz");
65
let b = a;
66
println!("{}", a);
67
}
@@ -114,7 +114,7 @@ move前后的a和b对应内存的地址不同。
114
如果我们想实现对**String**的”深拷贝“怎么办? 可以直接调用**String**的Clone特性实现对内存的值拷贝而不是简单的地址拷贝。
115
116
117
118
let b = a.clone(); // <-注意此处的clone
119
120
0 commit comments