summaryrefslogtreecommitdiff
path: root/exercises
diff options
context:
space:
mode:
authorliv <mokou@fastmail.com>2023-04-28 08:39:59 +0000
committerGitHub <noreply@github.com>2023-04-28 08:39:59 +0000
commit6ae0525f7a5e7f19a45ffce19354de4fc5b29816 (patch)
tree774bff0b77bce6980d3f49852e1b6a695b3f46fb /exercises
parent6d4a980b0408094e74cb22fd00d1b91559ce51dc (diff)
parentc4627e7112f38a74e677f358bf5eafc7214c5a4f (diff)
Merge pull request #1498 from esotuvaka/main
chore: clarified cow owned_no_mutation comments
Diffstat (limited to 'exercises')
-rw-r--r--exercises/smart_pointers/cow1.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/exercises/smart_pointers/cow1.rs b/exercises/smart_pointers/cow1.rs
index 885138a..bc5b28e 100644
--- a/exercises/smart_pointers/cow1.rs
+++ b/exercises/smart_pointers/cow1.rs
@@ -52,7 +52,8 @@ mod tests {
fn owned_no_mutation() -> Result<(), &'static str> {
// We can also pass `slice` without `&` so Cow owns it directly.
// In this case no mutation occurs and thus also no clone,
- // but the result is still owned because it always was.
+ // but the result is still owned because it was never borrowed
+ // or mutated.
let slice = vec![0, 1, 2];
let mut input = Cow::from(slice);
match abs_all(&mut input) {