Closed ghenry closed 3 months ago
assert!(result.is_ok());
takes a Result
and turns it into a bool by discarding all the error/success data it contained, then asserts that is true. This means the assert has no information about why. How about just result.unwrap();
?
Thanks. I didn't even think as basic as that. Much appreciated. Switching to result.unwrap();
instead of using an assert
, I get:
called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }
which is better...so definitely my beginner mistake. Feeling dumb now.
Hi all,
I'm using the following example:
https://github.com/rustls/tokio-rustls/blob/6f7373dad47df0b071c8f0f1a03376bed08331e7/examples/server.rs#L43
when the private key doesn't exist, how do you get that panic error message?
I'm using the example here https://github.com/SentryPeer/SentryPeer/blob/main/sentrypeer_rust/src/tls.rs#L180
and my
cargo test -- --nocapture
never shows it or withRUST_BACKTRACE=1
:this is probably my beginner mistake or misunderstanding or Tokio.
Any doc pointers you can share with me?
Thanks.