// FIXME https://github.com/jfaleiro/library-extensions-rs/issues/1 // #![no_std] use core_ext::convert::TryTo; #[derive(Debug)] enum Error {} struct A(u8); impl TryTo for A {} struct B(u8); impl TryFrom for B { type Error = Error; fn try_from(value: A) -> Result { Ok(Self(value.0 + 1)) } } impl TryTo for B {} struct C(u8); impl TryFrom for C { type Error = Error; fn try_from(value: B) -> Result { Ok(Self(value.0 + 2)) } } impl TryTo for C {} fn main() -> Result<(), Error> { assert_eq!(5_u8, A(2).try_to::()?.try_to::()?.0); Ok(()) }