Skip to content

Commit

Permalink
Return Option as Result<outof![E], AfterTake> (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
llehtahw authored Jan 10, 2024
1 parent 959c4cd commit 56cfb49
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion procs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,12 @@ fn generic_one_for_macro(
let #after_take_id = $expr;
let _closure = $closure;
let (after_take, res) = #block;
res.and_then(|x| Some(after_take.merge(x)))
if let Some(res) = res {
Ok(after_take.merge(res))
} else {
Err(after_take)
}

}
};
}
Expand Down

0 comments on commit 56cfb49

Please sign in to comment.