MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1y3320n/dynamicprogramming/19t27cj4iqqn7/?context=3
r/ProgrammerHumor • u/nerdycatgamer • 4d ago
152 comments sorted by
View all comments
Show parent comment
5
You don't need mem::replace for this, you can just use (a, b) = (b, c);
mem::replace
(a, b) = (b, c);
3 u/anonymity_is_bliss 4d ago Shit, TIL that works in rust 1 u/-Redstoneboi- 2d ago it wasn't always valid syntax, but they added support for it some time ago
3
Shit, TIL that works in rust
1 u/-Redstoneboi- 2d ago it wasn't always valid syntax, but they added support for it some time ago
1
it wasn't always valid syntax, but they added support for it some time ago
View all comments
Show parent comment
5
u/Dork_Knight_Rises 4d ago
You don't need
mem::replacefor this, you can just use(a, b) = (b, c);