Merge 8649f28cb3c11458bd8c6d6b2f9f881e75bb90e6 into 37cbcd9049627653a46f3a90d0d5dd5468464e1c

This commit is contained in:
DeoJin 2026-03-27 21:27:11 +00:00 committed by GitHub
commit 24c27d24e2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -57,9 +57,10 @@ mod tests {
#[test] #[test]
fn owned_mutation() { fn owned_mutation() {
// Of course this is also the case if a mutation does occur (not all // This is also the case if a mutation does occur (not all numbers are
// numbers are absolute). In this case, the call to `to_mut()` in the // absolute). Since `input` is already owned here, the call to
// `abs_all` function returns a reference to the same data as before. // `to_mut()` in `abs_all` returns a mutable reference to the existing
// owned data instead of cloning it.
let vec = vec![-1, 0, 1]; let vec = vec![-1, 0, 1];
let mut input = Cow::from(vec); let mut input = Cow::from(vec);
abs_all(&mut input); abs_all(&mut input);