Update ownershp.md

Added as_str() method to Q1, & removed answer that did not seem relevant to the question.
This commit is contained in:
Teddy Waweru 2023-01-27 23:58:29 +03:00 committed by GitHub
parent af2a2a6b3b
commit 65ab75f7d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -23,11 +23,10 @@ fn main() {
println!("{},{}",x,y);
}
```
```rust
fn main() {
let x = 10;
let y = x;
let x = String::from("hello, world");
let y = x.as_str();
println!("{},{}",x,y);
}
```