Add explanation to endian module

This commit is contained in:
Nils Andreas Svee committed 2022-10-15 13:49:05 +02:00
1 parent c82f777290
commit 34b3fc0850
1 file changed
+5
+5
View File
@@ -2,6 +2,11 @@ pub trait ToNativeEndian {
fn to_ne(self) -> Self;
}
/**
* A simple trait that adds a function to u32/u64 types
* to convert a number's endianness to native-endian
* based on the platform the code was built for
*/
impl ToNativeEndian for u32 {
#[cfg(target_endian = "big")]
fn to_ne(self) -> Self {