|
|
|
|
|
by tene
1495 days ago
|
|
That's really cool that you think Rust syntax could be significantly improved. I'd really love to hear some details. Here's the example from the post: Trying::to_read::<&'a heavy>(syntax, |like| { this. can_be( maddening ) }).map(|_| ())?;
How would you prefer to write this? |
|
First, lifetimes are elided in most cases.
Second, the curly braces for the closure are not needed and rustfmt gets rid of them.
Finally, the "map" on result can be replaced with a return statement below.
So, in the end we get something like: