Skip to content

Commit

Permalink
Fix link added in #2495 to be relative and at the bottom
Browse files Browse the repository at this point in the history
  • Loading branch information
carols10cents committed Dec 23, 2020
1 parent cf1c3d3 commit 1fdea76
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ch04-01-what-is-ownership.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ from Listing 4-1 using a `String` instead of a string literal:
```

There is a natural point at which we can return the memory our `String` needs
to the allocator: when `s` goes out of scope. When a variable goes out
of scope, Rust calls a special function for us. This function is called [`drop`](https://doc.rust-lang.org/std/ops/trait.Drop.html#tymethod.drop),
to the allocator: when `s` goes out of scope. When a variable goes out of
scope, Rust calls a special function for us. This function is called [`drop`],
and it’s where the author of `String` can put the code to return the memory.
Rust calls `drop` automatically at the closing curly bracket.

Expand Down Expand Up @@ -466,3 +466,4 @@ common. Luckily for us, Rust has a feature for this concept, called
[derivable-traits]: appendix-03-derivable-traits.html
[method-syntax]: ch05-03-method-syntax.html#method-syntax
[paths-module-tree]: ch07-03-paths-for-referring-to-an-item-in-the-module-tree.html
[`drop`]: ../std/ops/trait.Drop.html#tymethod.drop

0 comments on commit 1fdea76

Please sign in to comment.