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:
parent
7bffb7f2c4
commit
ee48c4684a
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user