Skip to content

Commit 05d1d39

Browse files
committed
update link and minor edit for clarity
1 parent cc3c052 commit 05d1d39

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

quiz_solutions/09_00_solution.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ fn main() {
3232

3333
And remember, the `*` operator is shorthand for calling the `deref` method of the `Deref` or `Deref Mut` traits.
3434

35-
Now the interesting thing is that the vector itself dereferences to a slice. This is because it implements the [`Deref Mut` trait](https://doc.rust-lang.org/std/ops/trait.DerefMut.html). Here is the [trait implementation](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2711):
35+
Now the interesting thing is that the vector itself dereferences to a slice. This is because it implements the [`Deref Mut` trait](https://doc.rust-lang.org/std/ops/trait.DerefMut.html). Here is the [trait implementation](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2769):
3636
```rust
3737
#[stable(feature = "rust1", since = "1.0.0")]
3838
impl<T, A: Allocator> ops::DerefMut for Vec<T, A> {
@@ -43,7 +43,7 @@ impl<T, A: Allocator> ops::DerefMut for Vec<T, A> {
4343
}
4444
```
4545

46-
So when we call `v.sort()`, this is equivalent of calling `*v.sort()` since Rust automatically follows references on method calls. `*v` will dereference to a slice and then Rust will call the `.sort` method on the slice.
46+
So when we call `v.sort()`, this is similar to calling `*v.sort()` since Rust automatically follows references on method calls. `*v` will dereference to a slice and then Rust will call the `.sort` method on the slice.
4747
```rust
4848
fn main() {
4949
let v = vec![1, 2, 3, 4];

0 commit comments

Comments
 (0)