use crate::{implementation, private, Asserter};
pub trait BooleanAssertion<IntoBoolean>: private::Sealed
where
IntoBoolean: Into<bool>,
{
#[track_caller]
#[allow(clippy::wrong_self_convention)]
fn is_true(self);
#[track_caller]
#[allow(clippy::wrong_self_convention)]
fn is_false(self);
}
impl<IntoBoolean> BooleanAssertion<IntoBoolean> for Asserter<IntoBoolean>
where
IntoBoolean: Into<bool>,
{
fn is_true(self) {
let actual = self.value.into();
implementation::assert(actual, actual, "to be", true);
}
fn is_false(self) {
let actual = self.value.into();
implementation::assert(!actual, actual, "to be", false);
}
}