From 262dd6964049632c2146538ec3ba44f63c8c6731 Mon Sep 17 00:00:00 2001 From: enforcer007 Date: Sun, 13 Nov 2022 15:10:11 +0530 Subject: [PATCH] cow --- exercises/standard_library_types/cow1.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/exercises/standard_library_types/cow1.rs b/exercises/standard_library_types/cow1.rs index 5fba2519..2e4483de 100644 --- a/exercises/standard_library_types/cow1.rs +++ b/exercises/standard_library_types/cow1.rs @@ -5,8 +5,6 @@ // It can enclose and provide immutable access to borrowed data, and clone the data lazily when mutation or ownership is required. // The type is designed to work with general borrowed data via the Borrow trait. -// I AM NOT DONE - use std::borrow::Cow; fn abs_all<'a, 'b>(input: &'a mut Cow<'b, [i32]>) -> &'a mut Cow<'b, [i32]> { @@ -42,7 +40,7 @@ fn main() { let mut input = Cow::from(slice); match abs_all(&mut input) { // TODO - Cow::Borrowed(_) => println!("I own this slice!"), + Cow::Owned(_) => println!("I own this slice!"), _ => panic!("expected borrowed value"), } }