A past puzzle — fully playable. 4 attempts, hints on wrong guesses.
stdle-55.rs
1fnmain(){
2leta=String::from("foo");
3letb=String::from("bar");
4letc=a+&b;
5println!("{}",c);
6}
Strings
Answer & explanation
Console output
foobar
Why
For strings, `+` is `String::add`, which takes `self` (an owned `String`) by value and a `&str` on the right. It MOVES the left `String` and appends, so `a` is consumed and `c` becomes "foobar". The `&b` coerces the `&String` to `&str`.