RosettaCodeData/Task/Collections/Rust/collections-4.rs
2024-10-16 18:07:41 -07:00

4 lines
129 B
Rust

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