Converted the endian structures to enumerations.

The BigEndian and LittleEndian structures were turned into enumerations
so that they could not be instantiated.
This commit is contained in:
Jason Travis Smith 2016-01-19 12:02:53 -05:00
parent 307118412b
commit d1c4b3e053

View File

@ -7,14 +7,6 @@ use ::converter::Converter;
/// Handles serialization where the most
/// significant byte is stored at the lowest address.
pub struct BigEndian;
/// Handles serialization where the most
/// significant byte is stored at the lowest address.
pub struct LittleEndian;
/// Defines the current platforms endianess. /// Defines the current platforms endianess.
/// This is can only be big endian or little endian. /// This is can only be big endian or little endian.
/// This library does not support a mixed endian setting. /// This library does not support a mixed endian setting.
@ -30,6 +22,18 @@ pub type PlatformEndian = BigEndian;
#[cfg(not(target_endian="big"))] #[cfg(not(target_endian="big"))]
pub type PlatformEndian = LittleEndian; pub type PlatformEndian = LittleEndian;
/// Handles serialization where the most
/// significant byte is stored at the lowest address.
pub enum BigEndian
{
}
/// Handles serialization where the most
/// significant byte is stored at the lowest address.
pub enum LittleEndian
{
}
/// Create an enumeration of the different /// Create an enumeration of the different
/// available endianesses. /// available endianesses.
#[derive(Clone, Copy)] #[derive(Clone, Copy)]