Comment

Comment by bigstrat2003

I'm really confused by the unwrap_or_break example in this text. The article says it wouldn't be possible to do without a macro, but how is it not equivalent to

  for d: Option<i32> in data {
    let val: i32 = match d {
      Some(v) => v,
      None => break
    };
    // Other stuff
  }
As far as I can tell that would do the exact same thing as the macro example.
parent bigstrat2003 5 months ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton