RosettaCodeData/Task/Collections/Rust/collections-4.rust
2016-12-05 22:15:40 +01:00

4 lines
129 B
Text

let x = "abc"; // x is of type &str (a borrowed string slice)
let s = String::from(x);
// or alternatively
let s = x.to_owned();