News for hackers. Stuff that matters.
Re:Fast Rust Builds by yakubin on Monday September 06, 2021 @07:28AM (#28432656)
It wasn't. Without "!" it isn't obvious that you cannot take a:

  let a: Result<u8, u8> = /* whatever *;
  let b = match a {
      Ok(v) => Ok(foo(v)),
      e => e,
  };
and transform it into:

  let a: Result<u8, u8> = /* whatever *;
  let b = a.map(foo);
if "foo" is a macro. When you substitute "foo!" for all the "foo" above, it is obvious.
Re:Fast Rust Builds by simon_o on Monday September 06, 2021 @07:32AM (#28432670)
Perhaps macros shouldn't do things that aren't "obvious" then?
Re:Fast Rust Builds by infogulch on Monday September 06, 2021 @09:11AM (#28433316)
As a rule, rust rejects the "simpler" choice that instead lay the burden of correctness at the feet of the user. I'm glad they keep a hard line here.