From 4aa410ad7e0f2909b4d070367fcf3b59140389c8 Mon Sep 17 00:00:00 2001 From: Jason Travis Smith Date: Wed, 6 Jan 2016 02:04:23 -0500 Subject: [PATCH] Making the associated constant Number::BYTES a usize. As much as I prefer to have tighter types for variables, this seems to make writing code easier and cleaner. --- src/number.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/number.rs b/src/number.rs index 88a56e8..776e432 100644 --- a/src/number.rs +++ b/src/number.rs @@ -19,7 +19,7 @@ pub trait Number : Zero + One + Add + Sub + /// The amount of Bytes required to represent this Number. - const BYTES: u8; + const BYTES: usize; /// Create a number from a given string and base radix. @@ -757,7 +757,7 @@ macro_rules! int_number_trait_impl type StrRadixError = ::std::num::ParseIntError; - const BYTES: u8 = <$varType>::BYTES; + const BYTES: usize = <$varType>::BYTES; fn from_str_radix(src: &str, radix: u32) -> @@ -780,7 +780,7 @@ macro_rules! float_number_trait_impl type StrRadixError = ::std::num::ParseFloatError; - const BYTES: u8 = $numBytes; + const BYTES: usize = $numBytes; fn from_str_radix(src: &str, radix: u32) ->