let a = "abcd";
let b = a;
let c = a;
let x = String::from("abcd");
let y = x;
let z = x;
I get the error:
error[E0382]: use of moved value: `x`
--> src/lib.rs:7:13
|
5 | let x = String::from("abcd");
| - move occurs because `x` has type `String`, which does not implement the `Copy` trait
6 | let y = x;
| - value moved here
7 | let z = x;
| ^ value used here after move
Am I not supposed to get same error for a
?