1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-01-04 07:24:22 +02:00

Fix typo in string.md (#473)

This commit is contained in:
JeongHyeon Lee 2023-03-05 01:22:04 +09:00 committed by GitHub
parent a78d58ba56
commit 05eb17a6fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,7 +27,7 @@ fn main() {
<details>
* `String::new` returns a new empty string, use `String::with capacity` when you know how much data you want to push to the string.
* `String::new` returns a new empty string, use `String::with_capacity` when you know how much data you want to push to the string.
* `String::len` returns the size of the `String` in bytes (which can be different from its length in characters).
* `String::chars` returns an iterator over the actual characters. Note that a `char` can be different from what a human will consider a "character" due to [grapheme clusters](https://docs.rs/unicode-segmentation/latest/unicode_segmentation/struct.Graphemes.html).
* When people refer to strings they could either be talking about `&str` or `String`.