1
0
Fork 0
mirror of https://github.com/notohh/rustlings.git synced 2025-08-11 13:33:18 -04:00

Merge branch 'main' into patch-2

This commit is contained in:
Aaron Wang 2023-05-01 19:10:56 -04:00 committed by GitHub
commit d3fea5f15a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 46 additions and 5 deletions
exercises/smart_pointers

View file

@ -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) {