From d1c4b3e05390f8940ba1480de6b5ab6d1307a9af Mon Sep 17 00:00:00 2001 From: Jason Travis Smith Date: Tue, 19 Jan 2016 12:02:53 -0500 Subject: [PATCH] Converted the endian structures to enumerations. The BigEndian and LittleEndian structures were turned into enumerations so that they could not be instantiated. --- src/endian.rs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/endian.rs b/src/endian.rs index 616f562..9827c52 100644 --- a/src/endian.rs +++ b/src/endian.rs @@ -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. /// This is can only be big endian or little endian. /// This library does not support a mixed endian setting. @@ -30,6 +22,18 @@ pub type PlatformEndian = BigEndian; #[cfg(not(target_endian="big"))] 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 /// available endianesses. #[derive(Clone, Copy)]