fix(proc): use TryFromDsl locally

This commit is contained in:
🪞👃🪞 2025-05-14 14:35:38 +03:00
parent bad20f5037
commit a9619ab9ce
3 changed files with 10 additions and 10 deletions

View file

@ -5,3 +5,12 @@ pub type Usually<T> = Result<T, Box<dyn Error>>;
/// Standard optional result type.
pub type Perhaps<T> = Result<Option<T>, Box<dyn Error>>;
/// Implement the `From` trait.
#[macro_export] macro_rules! from {
($(<$($lt:lifetime),+>)?|$state:ident:$Source:ty|$Target:ty=$cb:expr) => {
impl $(<$($lt),+>)? From<$Source> for $Target {
fn from ($state:$Source) -> Self { $cb }
}
};
}