You've already forked comprehensive-rust
mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-12-23 06:56:25 +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:
@@ -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. -->
|
||||
|
||||
Reference in New Issue
Block a user