use crate::error::ConverterError; /// Method for converting u32 to u64. pub fn u32_to_u64(value: u32) -> Result { match u64::try_from(value) { Err(error) => Err(ConverterError::Infallible(error)), Ok(result) => Ok(result), } } /// Method for converting u32 to usize. pub fn u32_to_usize(value: u32) -> Result { match usize::try_from(value) { Err(error) => Err(ConverterError::TryFromIntError(error)), Ok(result) => Ok(result), } } /// Method for converting u64 to u32. pub fn u64_to_u32(value: u64) -> Result { match u32::try_from(value) { Err(error) => Err(ConverterError::TryFromIntError(error)), Ok(result) => Ok(result), } } /// Method for converting usize to u32. pub fn usize_to_u32(value: usize) -> Result { match u32::try_from(value) { Err(error) => Err(ConverterError::TryFromIntError(error)), Ok(result) => Ok(result), } }