A

Admin • 833.24K Points
Coach

Q. What is the result of `let x = String::from("hi"); let y = x;`?

  • (A) `x` is cloned
  • (B) `x` and `y` share ownership
  • (C) `x` is moved to `y`
  • (D) Both `x` and `y` are dropped
  • Correct Answer - Option(C)
  • Views: 25
  • Filed under category Rust
  • Hashtags:

Explanation by: Admin

Ownership of `x` is moved to `y`, and `x` is no longer valid.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.