#[macro_export(local_inner_macros)]
macro_rules! impl_from_uint_for {
    ($to_type:ty, $($t:ty),*) => {
        $(
            impl From<$t> for $to_type {
                fn from(value: $t) -> Self {
                    <$to_type>::from(BigUint::from(value))
                }
            }
        )*
    };
}

#[macro_export(local_inner_macros)]
macro_rules! impl_compare_unit_for {
    ($to_type:ty, $($t:ty),*) => {
        $(

            impl PartialEq<$t> for $to_type {
                fn eq(&self, other: &$t) -> bool {
                    self.0 == BigUint::from(*other)
                }
            }

            impl PartialOrd<$t> for $to_type {
                fn partial_cmp(&self, other: &$t) -> Option<std::cmp::Ordering> {
                    self.0.partial_cmp(&BigUint::from(*other))
                }
            }
        )*
    };
}
