1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-04-26 17:23:01 +02:00

Clarify String definition (#2044)

Changed string definitions in string.md and strings.md files according
to discussion #2028
This commit is contained in:
Enes Aydın 2024-05-06 19:33:46 +03:00 committed by GitHub
parent b6343d0522
commit 40fce81e1c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -11,7 +11,7 @@ Including `&str` as a way of representing a slice of valid utf-8
We can now understand the two string types in Rust:
- `&str` is a slice of UTF-8 encoded bytes, similar to `&[u8]`.
- `String` is an owned, heap-allocated buffer of UTF-8 bytes.
- `String` is an owned buffer of UTF-8 encoded bytes, similar to `Vec<T>`.
<!-- Avoid using fixed integers when slicing since this breaks
translations. Using the length of s1 and s2 is safe. -->

View File

@ -4,7 +4,7 @@ minutes: 10
# String
[`String`][1] is the standard heap-allocated growable UTF-8 string buffer:
[`String`][1] is a growable UTF-8 encoded string:
```rust,editable
fn main() {