File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -17,9 +17,11 @@ fn main() {
17
17
// --- 👽 UFO Appears! Time to SUCK the Cow! ---
18
18
// The UFO wants to "modify" the cow (i.e., abduct it!).
19
19
// If it's a borrowed cow, the UFO needs to make its OWN copy to take!
20
- // (This simulates `to_mut()` forcing a copy for modification)
21
20
println!("2. OH NO! A UFO appears! 👽");
21
+
22
+ // This forcing 👇 a copy for modification
22
23
peaceful_cow.to_mut().push_str(" AIEEEE! I'm being beamed up! ⬆️");
24
+
23
25
println!(" Cow after abduction attempt: {}", peaceful_cow);
24
26
println!(" (Since it was borrowed, the UFO made a *copy* to abduct. The original is safe... for now! 🚀)\n");
25
27
@@ -35,7 +37,7 @@ fn main() {
35
37
// But since this cow is *already owned*, the UFO can just grab *this specific cow*.
36
38
// No new copy is needed because it's already "owned" for modification.
37
39
println!("4. Another UFO! This one's persistent! 🛸");
38
- owned_cow.to_mut().push_str(" Help! They're taking MY barn too! 😵💫 ");
40
+ owned_cow.to_mut().push_str(" Help! They're taking MY barn too! 😱 ");
39
41
println!(" Owned Cow after abduction: {}", owned_cow);
40
42
println!(" (It was already owned, so the UFO just took *that* cow. Efficient abduction! 💯)\n");
41
43
You can’t perform that action at this time.
0 commit comments