Skip to content

Commit 85e089b

Browse files
committed
fix: add missing `#[track_caller] annotations on assertion methods
1 parent 199e95f commit 85e089b

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/assertions.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,24 +532,28 @@ pub trait AssertHasLength<E> {
532532

533533
/// Verifies that the subject has a length that is less than the expected
534534
/// length.
535+
#[track_caller]
535536
fn has_length_less_than(self, expected_length: E) -> Self;
536537

537538
/// Verifies that the subject has a length that is greater than the expected
538539
/// length.
540+
#[track_caller]
539541
fn has_length_greater_than(self, expected_length: E) -> Self;
540542

541543
/// Verifies that the subject has a length that is at most the expected
542544
/// length.
543545
///
544546
/// In other words, the length shall be less than or equal to the expected
545547
/// length.
548+
#[track_caller]
546549
fn has_at_most_length(self, expected_length: E) -> Self;
547550

548551
/// Verifies that the subject has a length that is at least the expected
549552
/// length.
550553
///
551554
/// In other words, the length shall be greater than or equal to the
552555
/// expected length.
556+
#[track_caller]
553557
fn has_at_least_length(self, expected_length: E) -> Self;
554558
}
555559

@@ -716,6 +720,7 @@ pub trait AssertResultValue<'a, T, E, R> {
716720
/// Maps the subject to the result's err value.
717721
///
718722
/// If the result is an ok value, this method panics.
723+
#[track_caller]
719724
fn err(self) -> Spec<'a, E, R>;
720725
}
721726

0 commit comments

Comments
 (0)