diff --git a/units/src/parse.rs b/units/src/parse.rs index 398a87798..d1f402dec 100644 --- a/units/src/parse.rs +++ b/units/src/parse.rs @@ -131,22 +131,6 @@ macro_rules! impl_tryfrom_str_from_int_infallible { } } -/// Implements `TryFrom<$from> for $to`. -#[macro_export] -macro_rules! impl_tryfrom_str { - ($($from:ty, $to:ty, $err:ty, $inner_fn:expr);*) => { - $( - impl $crate::_export::_core::convert::TryFrom<$from> for $to { - type Error = $err; - - fn try_from(s: $from) -> $crate::_export::_core::result::Result { - $inner_fn(s) - } - } - )* - } -} - /// Implements standard parsing traits for `$type` by calling into `$inner_fn`. #[macro_export] macro_rules! impl_parse_str { @@ -165,6 +149,22 @@ macro_rules! impl_parse_str { } } +/// Implements `TryFrom<$from> for $to`. +#[macro_export] +macro_rules! impl_tryfrom_str { + ($($from:ty, $to:ty, $err:ty, $inner_fn:expr);*) => { + $( + impl $crate::_export::_core::convert::TryFrom<$from> for $to { + type Error = $err; + + fn try_from(s: $from) -> $crate::_export::_core::result::Result { + $inner_fn(s) + } + } + )* + } +} + /// Removes the prefix `0x` (or `0X`) from a hex string. /// /// # Errors