Comment

Comment by viraptor

It skips a block you'd need otherwise. Without it, you'd have to do something like:

    fn try_option_some() -> Option<u8> {
      if let val = Some(1) {
        Some(val)
      } else {
        None
      }
    }
It's an early exit if the expression before is None/Error
parent viraptor 9 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton