From 90d7e750967de2186a13f3ec2e3fd87dcad71a2b Mon Sep 17 00:00:00 2001 From: Nils Andreas Svee Date: Fri, 20 Feb 2026 21:38:36 +0700 Subject: [PATCH] refactor: remove custom endian traits in favor of standard library --- src/endian.rs | 32 -------------------------------- src/main.rs | 1 - 2 files changed, 33 deletions(-) delete mode 100644 src/endian.rs diff --git a/src/endian.rs b/src/endian.rs deleted file mode 100644 index 18e4da3..0000000 --- a/src/endian.rs +++ /dev/null @@ -1,32 +0,0 @@ -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 { - self.to_be() - } - - #[cfg(target_endian = "little")] - fn to_ne(self) -> Self { - self.to_le() - } -} - -impl ToNativeEndian for u64 { - #[cfg(target_endian = "big")] - fn to_ne(self) -> Self { - self.to_be() - } - - #[cfg(target_endian = "little")] - fn to_ne(self) -> Self { - self.to_le() - } -} diff --git a/src/main.rs b/src/main.rs index 349b3b6..4eb1b68 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,7 +2,6 @@ extern crate core; mod baseliner; mod config; -mod endian; mod log; mod netlink; mod pinger;