From 34b3fc0850881a084e4ac80ad1dd9b27ed6c091c Mon Sep 17 00:00:00 2001 From: Nils Andreas Svee Date: Sat, 15 Oct 2022 13:49:05 +0200 Subject: [PATCH] Add explanation to endian module --- src/endian.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/endian.rs b/src/endian.rs index 5f6e9bf..18e4da3 100644 --- a/src/endian.rs +++ b/src/endian.rs @@ -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 {