News for hackers. Stuff that matters.
Re:Rust: A Critical Retrospective by tene on Thursday May 19, 2022 @09:49PM (#31442444)
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?
Re:Rust: A Critical Retrospective by chmln on Thursday May 19, 2022 @09:58PM (#31442500)
That whole example feels like a strawman, from my (maybe limited) experience something that's rather the exception than the norm.

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:

  Trying::to_read(syntax, |like| this.can_be(maddening))?; 
  Ok(())
Re:Rust: A Critical Retrospective by iopq on Sunday May 29, 2022 @11:16PM (#31555156)
That part is actually not so bad?

  Trying\to_read\[&'a heavy](syntax, |like| { this. can_be( maddening ) }).map(|_| ())?;
I can't improve it that much