Update ownershp.md
Added as_str() method to Q1, & removed answer that did not seem relevant to the question.
This commit is contained in:
parent
af2a2a6b3b
commit
65ab75f7d9
|
@ -23,11 +23,10 @@ fn main() {
|
||||||
println!("{},{}",x,y);
|
println!("{},{}",x,y);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
fn main() {
|
fn main() {
|
||||||
let x = 10;
|
let x = String::from("hello, world");
|
||||||
let y = x;
|
let y = x.as_str();
|
||||||
println!("{},{}",x,y);
|
println!("{},{}",x,y);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue