From 2810b08b0d637eb5519d14f06b8a91b2f1e9a187 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Thu, 18 Jan 2024 08:02:39 +1100 Subject: [PATCH] io: Add code comment to feature gate This feature gate requires a little thought to understand, add a code comment to save the next guy some clock cycles. --- io/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/io/src/lib.rs b/io/src/lib.rs index b52c5bdb..bde143e1 100644 --- a/io/src/lib.rs +++ b/io/src/lib.rs @@ -161,7 +161,7 @@ impl BufRead for R { fn consume(&mut self, amount: usize) { std::io::BufRead::consume(self, amount) } } -#[cfg(not(feature = "std"))] +#[cfg(not(feature = "std"))] // Conflicts with blanket impl when "std" is enabled. impl Read for &[u8] { #[inline] fn read(&mut self, buf: &mut [u8]) -> Result { @@ -172,7 +172,7 @@ impl Read for &[u8] { } } -#[cfg(not(feature = "std"))] +#[cfg(not(feature = "std"))] // Conflicts with blanket impl when "std" is enabled. impl BufRead for &[u8] { #[inline] fn fill_buf(&mut self) -> Result<&[u8]> { Ok(self) }