diff options
| author | Brian Anderson <banderson@mozilla.com> | 2015-02-19 18:39:38 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2015-02-19 18:39:38 -0800 |
| commit | 96be55376ecdc13b0e711fe9398c70cd932af166 (patch) | |
| tree | 70b797915d9f4517ec37862b66733d75f1829d2d /src/doc/trpl/strings.md | |
| parent | 522d09dfecbeca1595f25ac58c6d0178bbd21d7d (diff) | |
| download | rust-96be55376ecdc13b0e711fe9398c70cd932af166.tar.gz rust-96be55376ecdc13b0e711fe9398c70cd932af166.zip | |
book: Minor clarifications about strings
Diffstat (limited to 'src/doc/trpl/strings.md')
| -rw-r--r-- | src/doc/trpl/strings.md | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/doc/trpl/strings.md b/src/doc/trpl/strings.md index 8ebebc98baf..2c2e6a8c7c5 100644 --- a/src/doc/trpl/strings.md +++ b/src/doc/trpl/strings.md @@ -25,8 +25,10 @@ compiled program, and exists for the entire duration it runs. The `string` binding is a reference to this statically allocated string. String slices have a fixed size, and cannot be mutated. -A `String`, on the other hand, is an in-memory string. This string is -growable, and is also guaranteed to be UTF-8. +A `String`, on the other hand, is a heap-allocated string. This string +is growable, and is also guaranteed to be UTF-8. `String`s are +commonly created by converting from a string slice using the +`to_string` method. ```{rust} let mut s = "Hello".to_string(); // mut s: String |
