by capitainenemo on 2/13/2023, 6:41:56 PM
by echelon on 2/13/2023, 6:38:28 PM
Cute technique, but it looks too syntactically sugary and dangerous.
For instance, if I wanted to make an immutable mutable, I'd rather be explicit:
let x = "foo".to_string();
let mut x = x;
Much clearer than passing ownership to a block and returning the expression.
Unfortunately since this is from 2015, it does not seem everything is still accurate. For example his demo of a list walk with match: https://play.rust-lang.org/?gist=613e13fd515bfca647ca&versio...
Seems to compile just fine even with the edition set to 2015.