Learn Rust
Preview · OwnershipA story to start with

You're porting a signup endpoint from Express. The request body arrives as an owned String. You log it for debugging, then save it. In JavaScript this is fine. Here the compiler stops you at the second call.

rust
fn log(s: String) { println!("{s}"); }

let body: String = read_body();
log(body);
save(body); // error[E0382]: use of moved value

Which changes make this compile?

Select all that apply. Sometimes none do.
A few stories. No account needed.
More ways to practice
Explore the mapYour progress