Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,7 @@ impl<L, R> Either<L, R> {
/// let right: Either<(), _> = Right(3);
/// right.unwrap_left();
/// ```
#[track_caller]
pub fn unwrap_left(self) -> L
where
R: core::fmt::Debug,
Expand Down Expand Up @@ -838,6 +839,7 @@ impl<L, R> Either<L, R> {
/// let left: Either<_, ()> = Left(3);
/// left.unwrap_right();
/// ```
#[track_caller]
pub fn unwrap_right(self) -> R
where
L: core::fmt::Debug,
Expand Down Expand Up @@ -867,6 +869,7 @@ impl<L, R> Either<L, R> {
/// let right: Either<(), _> = Right(3);
/// right.expect_left("value was Right");
/// ```
#[track_caller]
pub fn expect_left(self, msg: &str) -> L
where
R: core::fmt::Debug,
Expand Down Expand Up @@ -896,6 +899,7 @@ impl<L, R> Either<L, R> {
/// let left: Either<_, ()> = Left(3);
/// left.expect_right("value was Right");
/// ```
#[track_caller]
pub fn expect_right(self, msg: &str) -> R
where
L: core::fmt::Debug,
Expand Down