1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-01-18 20:39:35 +02:00

Fix typo: include semi colon in code (#1335)

This commit is contained in:
Noam Zaks 2023-10-10 11:15:21 +03:00 committed by GitHub
parent 7bffb7f2c4
commit ee48c4684a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,7 +33,7 @@ fn main() {
* When people refer to strings they could either be talking about `&str` or `String`.
* When a type implements `Deref<Target = T>`, the compiler will let you transparently call methods from `T`.
* `String` implements `Deref<Target = str>` which transparently gives it access to `str`'s methods.
* Write and compare `let s3 = s1.deref();` and `let s3 = &*s1`;.
* Write and compare `let s3 = s1.deref();` and `let s3 = &*s1;`.
* `String` is implemented as a wrapper around a vector of bytes, many of the operations you see supported on vectors are also supported on `String`, but with some extra guarantees.
* Compare the different ways to index a `String`:
* To a character by using `s3.chars().nth(i).unwrap()` where `i` is in-bound, out-of-bounds.