News for hackers. Stuff that matters.
Re:From Rust to TypeScript by estebank on Saturday September 12, 2020 @03:10PM (#24454692)
That code desugars to the following

  fn foo() -> Result<int, SomeError> {
     let result = match bar() {
         Ok(val) => val,
         Err(err) => return Err(err.into()),
     };
     let result2 = match baz()  {
         Ok(val) => val,
         Err(err) => return Err(err.into()),
     };
     let result3 = match bazz() {
         Ok(val) => val,
         Err(err) => return Err(err.into()),
     };
     Ok(result + result2 + result3)
  }

There are no comments on this comment yet.