From ebdfc661d2ed8647f2196b286ce298aeaa1d0e9e Mon Sep 17 00:00:00 2001 From: EliKalter <02374elim@gmail.com> Date: Tue, 16 Sep 2025 14:37:18 +0300 Subject: [PATCH] Improved grammar --- src/ch04-02-references-and-borrowing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ch04-02-references-and-borrowing.md b/src/ch04-02-references-and-borrowing.md index 8e427b5870..7fef0ab367 100644 --- a/src/ch04-02-references-and-borrowing.md +++ b/src/ch04-02-references-and-borrowing.md @@ -66,7 +66,7 @@ The expression `&m1` uses the ampersand operator to create a reference to (or "b Observe at L2 that there are two steps from `g1` to the string "Hello". `g1` is a reference that points to `m1` on the stack, and `m1` is a String containing a box that points to "Hello" on the heap. -While `m1` owns the heap data "Hello", `g1` does _not_ own either `m1` or "Hello". Therefore after `greet` ends and the program reaches L3, no heap data has been deallocated. Only the stack frame for `greet` disappears. This fact is consistent with our *Box Deallocation Principle*. Because `g1` did not own "Hello", Rust did not deallocate "Hello" on behalf of `g1`. +While `m1` owns the heap data "Hello", `g1` does _not_ own neither `m1` nor "Hello". Therefore after `greet` ends and the program reaches L3, no heap data has been deallocated. Only the stack frame for `greet` disappears. This fact is consistent with our *Box Deallocation Principle*. Because `g1` did not own "Hello", Rust did not deallocate "Hello" on behalf of `g1`. References are **non-owning pointers**, because they do not own the data they point to.