News for hackers. Stuff that matters.
Re:Using unwrap() in Rust is okay by xvedejas on Monday August 08, 2022 @01:13PM (#32388264)
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),
        }
      }
    }

There are no comments on this comment yet.