An underappreciated (imo) #rustlang feature is the struct update syntax: https://doc.rust-lang.org/nightly/book/ch05-01-defining-structs.html#creating-instances-from-other-instances-with-struct-update-syntax …
Super useful when you want *mostly* default fields on a struct, but you want to set explicit values for one or two
-
Show this thread
-
Replying to @randomPoison @rustlang
Question about this... Are the values moved when we do this?
1 reply 0 retweets 0 likes -
Replying to @augustocdias @rustlang
Huh, I hadn't considered that, but I'm pretty confident that they're being moved. Otherwise that would require implicit cloning, which Rust doesn't do
1 reply 0 retweets 0 likes
Replying to @randomPoison @augustocdias
Yes, they are
6:27 AM - 20 Feb 2019
0 replies
0 retweets
4 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.