Skip to content

Commit b93b6fd

Browse files
authored
Merge pull request #89 from innoave/feat/remove-assertborrowed-traits
feat!: remove unused traits `AssertBorrowedOptionValue` and `AssertBorrowedResultValue`
2 parents 7b62599 + 6c56249 commit b93b6fd

1 file changed

Lines changed: 0 additions & 96 deletions

File tree

src/assertions.rs

Lines changed: 0 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1907,46 +1907,6 @@ pub trait AssertOptionValue {
19071907
fn some(self) -> Self::Some;
19081908
}
19091909

1910-
/// Assert the value of a borrowed option by mapping the subject.
1911-
///
1912-
/// If the option is none, the assertion fails.
1913-
///
1914-
/// # Examples
1915-
///
1916-
/// ```
1917-
/// use asserting::prelude::*;
1918-
///
1919-
/// let subject: Option<Vec<usize>> = Some(vec![1, 2, 3]);
1920-
/// assert_that!(&subject).some().contains_exactly(&[1, 2, 3]);
1921-
///
1922-
/// let subject: Option<&str> = Some("ullamco cupiditat diam hendrerit");
1923-
/// assert_that!(&subject).some().is_not_empty();
1924-
/// ```
1925-
pub trait AssertBorrowedOptionValue {
1926-
/// A spec-like type that contains the option's borrowed value as the
1927-
/// subject, which is returned by the mapping assertion method.
1928-
///
1929-
/// If the subject is an `Option<&T>`, this is usually `Spec<'a, &'a T, R>`.
1930-
type Some;
1931-
1932-
/// Maps the subject to the option's value if it has some. Otherwise, this
1933-
/// assertion fails.
1934-
///
1935-
/// # Examples
1936-
///
1937-
/// ```
1938-
/// use asserting::prelude::*;
1939-
///
1940-
/// let subject: Option<Vec<usize>> = Some(vec![1, 2, 3]);
1941-
/// assert_that!(&subject).some().contains_exactly(&[1, 2, 3]);
1942-
///
1943-
/// let subject: Option<&str> = Some("ullamco cupiditat diam hendrerit");
1944-
/// assert_that!(&subject).some().is_not_empty();
1945-
/// ```
1946-
#[track_caller]
1947-
fn some(self) -> Self::Some;
1948-
}
1949-
19501910
/// Assert whether a subject of the `Result` type holds some value or an error.
19511911
///
19521912
/// # Examples
@@ -2044,62 +2004,6 @@ pub trait AssertResultValue {
20442004
fn err(self) -> Self::Err;
20452005
}
20462006

2047-
/// Assert the ok-value or error of a borrowed result by mapping the subject.
2048-
///
2049-
/// # Examples
2050-
///
2051-
/// ```
2052-
/// use asserting::prelude::*;
2053-
///
2054-
/// let subject: Result<Vec<usize>, String> = Ok(vec![1, 2, 3]);
2055-
/// assert_that!(&subject).ok().is_not_empty();
2056-
///
2057-
/// let subject: Result<u64, String> = Err("te anim adipisici mollit".to_string());
2058-
/// assert_that!(&subject).err().is_equal_to("te anim adipisici mollit");
2059-
/// ```
2060-
pub trait AssertBorrowedResultValue {
2061-
/// A spec-like type that contains the result's borrowed ok value as the
2062-
/// subject, which is returned by the mapping assertion method.
2063-
///
2064-
/// If the subject is a `Result<T, E>`, this is usually `Spec<'a, &'a T, R>`.
2065-
type Ok;
2066-
/// A spec-like type that contains the result's borrowed error value as the
2067-
/// subject, which is returned by the mapping assertion method.
2068-
///
2069-
/// If the subject is a `Result<T, E>`, this is usually `Spec<'a, &'a E, R>`.
2070-
type Err;
2071-
2072-
/// Maps the subject to the result's ok value.
2073-
///
2074-
/// If the result is an error, this method panics.
2075-
///
2076-
/// # Examples
2077-
///
2078-
/// ```
2079-
/// use asserting::prelude::*;
2080-
///
2081-
/// let subject: Result<Vec<usize>, String> = Ok(vec![1, 2, 3]);
2082-
/// assert_that!(&subject).ok().contains_exactly(&[1, 2, 3]);
2083-
/// ```
2084-
#[track_caller]
2085-
fn ok(self) -> Self::Ok;
2086-
2087-
/// Maps the subject to the result's err value.
2088-
///
2089-
/// If the result is an ok value, this method panics.
2090-
///
2091-
/// # Examples
2092-
///
2093-
/// ```
2094-
/// use asserting::prelude::*;
2095-
///
2096-
/// let subject: Result<u64, String> = Err("te anim adipisici mollit".to_string());
2097-
/// assert_that!(&subject).err().is_equal_to("te anim adipisici mollit");
2098-
/// ```
2099-
#[track_caller]
2100-
fn err(self) -> Self::Err;
2101-
}
2102-
21032007
/// Assert that a subject of some container type holds a value that is equal to
21042008
/// the expected one.
21052009
///

0 commit comments

Comments
 (0)