Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

When you unwrap/expect on an error, the inner error value is already printed. Are you suggesting something more? Reference the implementation details from the article:

    impl<T, E: std::fmt::Debug> Result<T, E> {
      pub fn unwrap(self) -> T {
        match self {
          Ok(t) => t,
          Err(e) => panic!("called `Result::unwrap()` on an `Err` value: {:?}", e),
        }
      }
    }


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: