Making the Endian enumeration follow the standard of CamelCase names.

This commit is contained in:
Jason Travis Smith 2016-04-14 15:08:31 -04:00
parent 4291a1ef5d
commit 6ff27de3c7
2 changed files with 12 additions and 12 deletions

View File

@ -40,15 +40,15 @@ pub enum LittleEndian
pub enum Endianess pub enum Endianess
{ {
/// Referes to BigEndian. /// Referes to BigEndian.
BIG, Big,
/// Referes to LittleEndian. /// Referes to LittleEndian.
LITTLE, Little,
/// Referes to PlatformEndian. This can be anyone /// Referes to PlatformEndian. This can be anyone
/// of the other available endians depending on /// of the other available endians depending on
/// the platform you are on. /// the platform you are on.
PLATFORM Platform
} }

View File

@ -32,17 +32,17 @@ macro_rules! handle_endianess_to_bytes
{ {
match $endianess match $endianess
{ {
Endianess::BIG => Endianess::Big =>
{ {
$buffer.append(&mut BigEndian::$func(*$val)); $buffer.append(&mut BigEndian::$func(*$val));
} }
Endianess::LITTLE => Endianess::Little =>
{ {
$buffer.append(&mut LittleEndian::$func(*$val)); $buffer.append(&mut LittleEndian::$func(*$val));
} }
Endianess::PLATFORM => Endianess::Platform =>
{ {
$buffer.append(&mut PlatformEndian::$func(*$val)); $buffer.append(&mut PlatformEndian::$func(*$val));
} }
@ -60,17 +60,17 @@ macro_rules! handle_endianess_from_bytes
{ {
match $endianess match $endianess
{ {
Endianess::BIG => Endianess::Big =>
{ {
BigEndian::$func(&$buffer) BigEndian::$func(&$buffer)
} }
Endianess::LITTLE => Endianess::Little =>
{ {
LittleEndian::$func(&$buffer) LittleEndian::$func(&$buffer)
} }
Endianess::PLATFORM => Endianess::Platform =>
{ {
PlatformEndian::$func(&$buffer) PlatformEndian::$func(&$buffer)
} }
@ -441,17 +441,17 @@ impl Transmutable for String
// We are not using the macro because *String is a str. // We are not using the macro because *String is a str.
match endianess match endianess
{ {
Endianess::BIG => Endianess::Big =>
{ {
buffer.append(&mut BigEndian::string_to_bytes(temp)); buffer.append(&mut BigEndian::string_to_bytes(temp));
} }
Endianess::LITTLE => Endianess::Little =>
{ {
buffer.append(&mut LittleEndian::string_to_bytes(temp)); buffer.append(&mut LittleEndian::string_to_bytes(temp));
} }
Endianess::PLATFORM => Endianess::Platform =>
{ {
buffer.append(&mut PlatformEndian::string_to_bytes(temp)); buffer.append(&mut PlatformEndian::string_to_bytes(temp));
} }