diff --git a/solutions/ownership/ownership.md b/solutions/ownership/ownership.md index 1237fc02..5dbe38d3 100644 --- a/solutions/ownership/ownership.md +++ b/solutions/ownership/ownership.md @@ -79,6 +79,21 @@ fn give_ownership() -> String { } ``` +```rust +fn main() { + let s = give_ownership(); + println!("{:?}", s); +} + +// Only modify the code below! +fn give_ownership() -> Vec { + let s = String::from("Hello world"); + // Convert String to Vec + let s_bytes = s.into_bytes(); + s_bytes +} +``` + 4. ```rust