Skip to content

Commit 1e99e04

Browse files
authored
Merge pull request #129 from rakivo/main
feat: mark public panicking functions with `#[track_caller]`
2 parents 43e4fd5 + 91e4bf1 commit 1e99e04

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,7 @@ impl<L, R> Either<L, R> {
805805
/// let right: Either<(), _> = Right(3);
806806
/// right.unwrap_left();
807807
/// ```
808+
#[track_caller]
808809
pub fn unwrap_left(self) -> L
809810
where
810811
R: core::fmt::Debug,
@@ -836,6 +837,7 @@ impl<L, R> Either<L, R> {
836837
/// let left: Either<_, ()> = Left(3);
837838
/// left.unwrap_right();
838839
/// ```
840+
#[track_caller]
839841
pub fn unwrap_right(self) -> R
840842
where
841843
L: core::fmt::Debug,
@@ -865,6 +867,7 @@ impl<L, R> Either<L, R> {
865867
/// let right: Either<(), _> = Right(3);
866868
/// right.expect_left("value was Right");
867869
/// ```
870+
#[track_caller]
868871
pub fn expect_left(self, msg: &str) -> L
869872
where
870873
R: core::fmt::Debug,
@@ -894,6 +897,7 @@ impl<L, R> Either<L, R> {
894897
/// let left: Either<_, ()> = Left(3);
895898
/// left.expect_right("value was Right");
896899
/// ```
900+
#[track_caller]
897901
pub fn expect_right(self, msg: &str) -> R
898902
where
899903
L: core::fmt::Debug,

0 commit comments

Comments
 (0)