From 1977161aae344a6c26b7a9296d09a68209556485 Mon Sep 17 00:00:00 2001 From: Dzmitry Lahoda Date: Sat, 7 Nov 2020 08:21:55 +0300 Subject: [PATCH] add link to drop trait drop in ownership chapter --- src/ch04-01-what-is-ownership.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ch04-01-what-is-ownership.md b/src/ch04-01-what-is-ownership.md index 6be8794016..2c9ee54c40 100644 --- a/src/ch04-01-what-is-ownership.md +++ b/src/ch04-01-what-is-ownership.md @@ -216,7 +216,7 @@ 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`, +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), 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.