kakts-log

programming について調べたことを整理していきます

2018-04-22から1日間の記事一覧

Rust: Error for copying String allocated memory to new variable.

When I write Rust code as below, it occurs error. I tried to print two same String by copying memory. fn main() { let s1 = String::from("Hello"); let s2 = s1; println!("{}, {}", s1, s2); } error[E0382]: use of moved value: `s1` --> src/mai…