From: Matt Corallo Date: Tue, 8 Jan 2019 04:13:44 +0000 (-0500) Subject: Fix dead_code warnings in fuzztarget builds X-Git-Tag: v0.0.12~244^2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=refs%2Fheads%2F2019-01-fuzz-cleanups;p=rust-lightning Fix dead_code warnings in fuzztarget builds --- diff --git a/src/util/byte_utils.rs b/src/util/byte_utils.rs index 7230a4e1c..44445666f 100644 --- a/src/util/byte_utils.rs +++ b/src/util/byte_utils.rs @@ -10,6 +10,7 @@ pub fn slice_to_be32(v: &[u8]) -> u32 { ((v[2] as u32) << 8*1) | ((v[3] as u32) << 8*0) } +#[cfg(not(feature = "fuzztarget"))] // Used only by poly1305 #[inline] pub fn slice_to_le32(v: &[u8]) -> u32 { ((v[0] as u32) << 8*0) | @@ -54,6 +55,7 @@ pub fn be32_to_array(u: u32) -> [u8; 4] { v[3] = ((u >> 8*0) & 0xff) as u8; v } +#[cfg(not(feature = "fuzztarget"))] // Used only by poly1305 #[inline] pub fn le32_to_array(u: u32) -> [u8; 4] { let mut v = [0; 4]; diff --git a/src/util/mod.rs b/src/util/mod.rs index 1a6eb8049..c1b6c2300 100644 --- a/src/util/mod.rs +++ b/src/util/mod.rs @@ -6,6 +6,7 @@ pub mod ser; pub(crate) mod byte_utils; pub(crate) mod chacha20; +#[cfg(not(feature = "fuzztarget"))] pub(crate) mod poly1305; pub(crate) mod chacha20poly1305rfc; pub(crate) mod internal_traits;