mirror of
https://github.com/KaiserY/trpl-zh-cn
synced 2025-02-23 04:32:16 +08:00
commit
f5a85c1355
@ -41,7 +41,7 @@ let s = "initial contents".to_string();
|
||||
|
||||
这些代码会创建包含 `initial contents` 的字符串。
|
||||
|
||||
也可以使用 `String::from` 函数来从字符串字面值创建 `String`。示例 8-13 中的代码代码等同于使用 `to_string`。
|
||||
也可以使用 `String::from` 函数来从字符串字面值创建 `String`。示例 8-13 中的代码等同于使用 `to_string`。
|
||||
|
||||
```rust
|
||||
let s = String::from("initial contents");
|
||||
|
Loading…
Reference in New Issue
Block a user