Skip to content
This repository has been archived by the owner on Jan 4, 2024. It is now read-only.

Commit

Permalink
dont use ? in unwrap!
Browse files Browse the repository at this point in the history
we don't need the implicit .into() and it breaks some inference
  • Loading branch information
Sky9x committed Nov 22, 2023
1 parent 777c35e commit 5fb02b3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ use std::{env, fs};

macro_rules! unwrap {
($x:expr, $($fmt:tt)+) => {
anyhow::Context::with_context($x, || format!($($fmt)+))?
// dont use ? because we don't need the implicit .into() and it breaks some inference
match anyhow::Context::with_context($x, || format!($($fmt)+)) {
Ok(x) => x,
Err(e) => return Err(e),
}
};
}

Expand Down

0 comments on commit 5fb02b3

Please sign in to comment.