Add ExpectInto numerological conversion trait. (#357)

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2026-03-08 10:14:23 +00:00
parent 3fcfcafdd2
commit cf7a4dc88d
3 changed files with 24 additions and 6 deletions

View File

@@ -0,0 +1,12 @@
pub trait ExpectInto {
#[inline]
#[must_use]
fn expect_into<Dst: TryFrom<Self>>(self) -> Dst
where
Self: Sized,
{
super::expect_into::<Dst, Self>(self)
}
}
impl<T> ExpectInto for T {}