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.
This commit is contained in:
parent
4cf2bf4b40
commit
2810b08b0d
|
@ -161,7 +161,7 @@ impl<R: std::io::BufRead + Read + ?Sized> BufRead for R {
|
||||||
fn consume(&mut self, amount: usize) { std::io::BufRead::consume(self, amount) }
|
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] {
|
impl Read for &[u8] {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn read(&mut self, buf: &mut [u8]) -> Result<usize> {
|
fn read(&mut self, buf: &mut [u8]) -> Result<usize> {
|
||||||
|
@ -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] {
|
impl BufRead for &[u8] {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn fill_buf(&mut self) -> Result<&[u8]> { Ok(self) }
|
fn fill_buf(&mut self) -> Result<&[u8]> { Ok(self) }
|
||||||
|
|
Loading…
Reference in New Issue