From 84a954a0cafdf372393eebcd209cb363c0a19e36 Mon Sep 17 00:00:00 2001 From: Rowan Torbitzky-Lane Date: Thu, 20 Mar 2025 13:49:55 -0500 Subject: [PATCH] finish ch4.2 --- ch4/refs_and_borrow/src/main.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ch4/refs_and_borrow/src/main.rs b/ch4/refs_and_borrow/src/main.rs index 5be8cb2..3bcdced 100644 --- a/ch4/refs_and_borrow/src/main.rs +++ b/ch4/refs_and_borrow/src/main.rs @@ -100,8 +100,13 @@ fn main() { // ----------------------------------------------------------------------------- // Data must outlive all of its references - // Ended at: - // https://rust-book.cs.brown.edu/ch04-02-references-and-borrowing.html#summary + // ----------------------------------------------------------------------------- + // Summary + + // References provide ability to read/write data with consuming ownership. + // References created with borrows (& and &mut) used dereferenced with * (often implictly) + + // Off to fixing ownership issues in ch4.3 } fn greet(g1: String, g2: String) {