Use a string literal instead of String::from; that's not a method

We've talked about Strings vs string literals at this point. Hopefully
this should be less distracting.
This commit is contained in:
Carol (Nichols || Goulding) 2016-08-02 17:56:34 -04:00
parent bfc469d83a
commit e6443565eb

View File

@ -4,9 +4,9 @@ In the last section on ownership, we made several references to methods.
Methods look like this:
```rust
let s1 = String::from("hello");
let s1 = "hello";
// call a method on our String
// call a method on s1
let s2 = s1.clone();
println!("{}", s1);