mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
62ba3e70a1
The previous output was unintuitive to users.
16 lines
383 B
Rust
16 lines
383 B
Rust
fn main() {
|
|
let mut v = vec!["hello", "this", "is", "a", "test"];
|
|
|
|
let v2 = Vec::new();
|
|
|
|
v.into_iter().map(|s|s.to_owned()).collect::<Vec<_>>();
|
|
|
|
let mut a = String::new(); //~ NOTE expected due to this value
|
|
for i in v {
|
|
a = *i.to_string();
|
|
//~^ ERROR mismatched types
|
|
//~| NOTE expected `String`, found `str`
|
|
v2.push(a);
|
|
}
|
|
}
|