RosettaCodeData/Task/Collections/Rust/collections-4.rust

5 lines
129 B
Plaintext

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