Skip to content

Commit def3415

Browse files
authored
Merge pull request #40 from innoave/fix/missing-track-caller-annotations
fix: missing `#[track_caller] annotations on assertion methods
2 parents 4d7820f + b2c0dcc commit def3415

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
@@ -1064,6 +1064,7 @@ pub trait AssertHasLength<E> {
10641064
/// assert_that!(&some_map).has_length_less_than(5);
10651065
/// # }
10661066
/// ```
1067+
#[track_caller]
10671068
fn has_length_less_than(self, expected_length: E) -> Self;
10681069

10691070
/// Verifies that the subject has a length that is greater than the expected
@@ -1112,6 +1113,7 @@ pub trait AssertHasLength<E> {
11121113
/// assert_that!(&some_map).has_length_greater_than(3);
11131114
/// # }
11141115
/// ```
1116+
#[track_caller]
11151117
fn has_length_greater_than(self, expected_length: E) -> Self;
11161118

11171119
/// Verifies that the subject has a length that is at most the expected
@@ -1163,6 +1165,7 @@ pub trait AssertHasLength<E> {
11631165
/// assert_that!(&some_map).has_at_most_length(4);
11641166
/// # }
11651167
/// ```
1168+
#[track_caller]
11661169
fn has_at_most_length(self, expected_length: E) -> Self;
11671170

11681171
/// Verifies that the subject has a length that is at least the expected
@@ -1214,6 +1217,7 @@ pub trait AssertHasLength<E> {
12141217
/// assert_that!(&some_map).has_at_least_length(4);
12151218
/// # }
12161219
/// ```
1220+
#[track_caller]
12171221
fn has_at_least_length(self, expected_length: E) -> Self;
12181222
}
12191223

@@ -1520,6 +1524,7 @@ pub trait AssertResultValue<'a, T, E, R> {
15201524
/// let subject: Result<u64, String> = Err("te anim adipisici mollit".to_string());
15211525
/// assert_that!(subject).err().is_equal_to("te anim adipisici mollit");
15221526
/// ```
1527+
#[track_caller]
15231528
fn err(self) -> Spec<'a, E, R>;
15241529
}
15251530

0 commit comments

Comments
 (0)