(WIP) Expose io::Cursor.
This commit is contained in:
parent
b358934c5c
commit
d5e39c6460
@ -367,11 +367,12 @@ index a1002fd..3a00ffe 100644
|
||||
impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
let n = Read::read(&mut self.fill_buf()?, buf)?;
|
||||
@@ -219,7 +210,6 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
@@ -219,7 +210,7 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
}
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature = "collections")]
|
||||
impl<T> BufRead for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn fill_buf(&mut self) -> io::Result<&[u8]> {
|
||||
let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64);
|
||||
@ -383,19 +384,21 @@ index a1002fd..3a00ffe 100644
|
||||
impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn write(&mut self, data: &[u8]) -> io::Result<usize> {
|
||||
let pos = cmp::min(self.pos, self.inner.len() as u64);
|
||||
@@ -239,7 +228,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
@@ -239,7 +228,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature="collections")]
|
||||
impl Write for Cursor<Vec<u8>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
// Make sure the internal buffer is as least as big as where we
|
||||
@@ -267,7 +255,6 @@ impl Write for Cursor<Vec<u8>> {
|
||||
@@ -267,7 +255,7 @@ impl Write for Cursor<Vec<u8>> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "cursor_box_slice", since = "1.5.0")]
|
||||
+#[cfg(feature="alloc")]
|
||||
impl Write for Cursor<Box<[u8]>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
let pos = cmp::min(self.pos, self.inner.len() as u64);
|
||||
@ -1030,7 +1033,7 @@ index 28492b3..924d626 100644
|
||||
-mod buffered;
|
||||
-mod cursor;
|
||||
+#[cfg(feature="collections")] mod buffered;
|
||||
+#[cfg(feature="collections")] mod cursor;
|
||||
+mod cursor;
|
||||
mod error;
|
||||
mod impls;
|
||||
-mod lazy;
|
||||
|
@ -365,11 +365,12 @@ index 1b836b7..c77f287 100644
|
||||
impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
let n = Read::read(&mut self.fill_buf()?, buf)?;
|
||||
@@ -218,7 +210,6 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
@@ -218,7 +210,7 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
}
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature = "collections")]
|
||||
impl<T> BufRead for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn fill_buf(&mut self) -> io::Result<&[u8]> {
|
||||
let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64);
|
||||
@ -381,19 +382,21 @@ index 1b836b7..c77f287 100644
|
||||
impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
#[inline]
|
||||
fn write(&mut self, data: &[u8]) -> io::Result<usize> {
|
||||
@@ -239,7 +229,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
@@ -239,7 +229,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature="collections")]
|
||||
impl Write for Cursor<Vec<u8>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
// Make sure the internal buffer is as least as big as where we
|
||||
@@ -267,7 +256,6 @@ impl Write for Cursor<Vec<u8>> {
|
||||
@@ -267,7 +256,7 @@ impl Write for Cursor<Vec<u8>> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "cursor_box_slice", since = "1.5.0")]
|
||||
+#[cfg(feature="alloc")]
|
||||
impl Write for Cursor<Box<[u8]>> {
|
||||
#[inline]
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
@ -1029,7 +1032,7 @@ index 1053792..5acfe6a 100644
|
||||
-mod buffered;
|
||||
-mod cursor;
|
||||
+#[cfg(feature="collections")] mod buffered;
|
||||
+#[cfg(feature="collections")] mod cursor;
|
||||
+mod cursor;
|
||||
mod error;
|
||||
mod impls;
|
||||
-mod lazy;
|
||||
|
@ -367,11 +367,12 @@ index a1002fd..3a00ffe 100644
|
||||
impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
let n = Read::read(&mut self.fill_buf()?, buf)?;
|
||||
@@ -219,7 +210,6 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
@@ -219,7 +210,7 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
}
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature = "collections")]
|
||||
impl<T> BufRead for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn fill_buf(&mut self) -> io::Result<&[u8]> {
|
||||
let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64);
|
||||
@ -383,19 +384,21 @@ index a1002fd..3a00ffe 100644
|
||||
impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn write(&mut self, data: &[u8]) -> io::Result<usize> {
|
||||
let pos = cmp::min(self.pos, self.inner.len() as u64);
|
||||
@@ -239,7 +228,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
@@ -239,7 +228,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature="collections")]
|
||||
impl Write for Cursor<Vec<u8>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
// Make sure the internal buffer is as least as big as where we
|
||||
@@ -267,7 +255,6 @@ impl Write for Cursor<Vec<u8>> {
|
||||
@@ -267,7 +255,7 @@ impl Write for Cursor<Vec<u8>> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "cursor_box_slice", since = "1.5.0")]
|
||||
+#[cfg(feature="alloc")]
|
||||
impl Write for Cursor<Box<[u8]>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
let pos = cmp::min(self.pos, self.inner.len() as u64);
|
||||
@ -1030,7 +1033,7 @@ index 0f988c7..d6cd245 100644
|
||||
-mod buffered;
|
||||
-mod cursor;
|
||||
+#[cfg(feature="collections")] mod buffered;
|
||||
+#[cfg(feature="collections")] mod cursor;
|
||||
+mod cursor;
|
||||
mod error;
|
||||
mod impls;
|
||||
-mod lazy;
|
||||
|
@ -366,11 +366,12 @@ index ae0085f..5392880 100644
|
||||
impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
let n = Read::read(&mut self.fill_buf()?, buf)?;
|
||||
@@ -219,7 +211,6 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
@@ -219,7 +211,7 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
}
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature = "collections")]
|
||||
impl<T> BufRead for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn fill_buf(&mut self) -> io::Result<&[u8]> {
|
||||
let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64);
|
||||
@ -382,19 +383,21 @@ index ae0085f..5392880 100644
|
||||
impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
#[inline]
|
||||
fn write(&mut self, data: &[u8]) -> io::Result<usize> {
|
||||
@@ -240,7 +230,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
@@ -240,7 +230,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature="collections")]
|
||||
impl Write for Cursor<Vec<u8>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
let pos: usize = self.position().try_into().map_err(|_| {
|
||||
@@ -270,7 +259,6 @@ impl Write for Cursor<Vec<u8>> {
|
||||
@@ -270,7 +259,7 @@ impl Write for Cursor<Vec<u8>> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "cursor_box_slice", since = "1.5.0")]
|
||||
+#[cfg(feature="alloc")]
|
||||
impl Write for Cursor<Box<[u8]>> {
|
||||
#[inline]
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
@ -938,7 +941,7 @@ index 7310564..05d91fc 100644
|
||||
-mod buffered;
|
||||
-mod cursor;
|
||||
+#[cfg(feature="collections")] mod buffered;
|
||||
+#[cfg(feature="collections")] mod cursor;
|
||||
+mod cursor;
|
||||
mod error;
|
||||
mod impls;
|
||||
-mod lazy;
|
||||
|
@ -365,11 +365,12 @@ index 1b836b7..c77f287 100644
|
||||
impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
let n = Read::read(&mut self.fill_buf()?, buf)?;
|
||||
@@ -218,7 +210,6 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
@@ -218,7 +210,7 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
}
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature = "collections")]
|
||||
impl<T> BufRead for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn fill_buf(&mut self) -> io::Result<&[u8]> {
|
||||
let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64);
|
||||
@ -381,19 +382,21 @@ index 1b836b7..c77f287 100644
|
||||
impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
#[inline]
|
||||
fn write(&mut self, data: &[u8]) -> io::Result<usize> {
|
||||
@@ -239,7 +229,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
@@ -239,7 +229,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature="collections")]
|
||||
impl Write for Cursor<Vec<u8>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
// Make sure the internal buffer is as least as big as where we
|
||||
@@ -267,7 +256,6 @@ impl Write for Cursor<Vec<u8>> {
|
||||
@@ -267,7 +256,7 @@ impl Write for Cursor<Vec<u8>> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "cursor_box_slice", since = "1.5.0")]
|
||||
+#[cfg(feature="alloc")]
|
||||
impl Write for Cursor<Box<[u8]>> {
|
||||
#[inline]
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
@ -1029,7 +1032,7 @@ index 0de02cb..0f202c2 100644
|
||||
-mod buffered;
|
||||
-mod cursor;
|
||||
+#[cfg(feature="collections")] mod buffered;
|
||||
+#[cfg(feature="collections")] mod cursor;
|
||||
+mod cursor;
|
||||
mod error;
|
||||
mod impls;
|
||||
-mod lazy;
|
||||
|
@ -367,11 +367,12 @@ index a1002fd..3a00ffe 100644
|
||||
impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
let n = Read::read(&mut self.fill_buf()?, buf)?;
|
||||
@@ -219,7 +210,6 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
@@ -219,7 +210,7 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
}
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature = "collections")]
|
||||
impl<T> BufRead for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn fill_buf(&mut self) -> io::Result<&[u8]> {
|
||||
let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64);
|
||||
@ -383,19 +384,21 @@ index a1002fd..3a00ffe 100644
|
||||
impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn write(&mut self, data: &[u8]) -> io::Result<usize> {
|
||||
let pos = cmp::min(self.pos, self.inner.len() as u64);
|
||||
@@ -239,7 +228,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
@@ -239,7 +228,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature="collections")]
|
||||
impl Write for Cursor<Vec<u8>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
// Make sure the internal buffer is as least as big as where we
|
||||
@@ -267,7 +255,6 @@ impl Write for Cursor<Vec<u8>> {
|
||||
@@ -267,7 +255,7 @@ impl Write for Cursor<Vec<u8>> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "cursor_box_slice", since = "1.5.0")]
|
||||
+#[cfg(feature="alloc")]
|
||||
impl Write for Cursor<Box<[u8]>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
let pos = cmp::min(self.pos, self.inner.len() as u64);
|
||||
@ -1030,7 +1033,7 @@ index 6dd7273..ba07b2c 100644
|
||||
-mod buffered;
|
||||
-mod cursor;
|
||||
+#[cfg(feature="collections")] mod buffered;
|
||||
+#[cfg(feature="collections")] mod cursor;
|
||||
+mod cursor;
|
||||
mod error;
|
||||
mod impls;
|
||||
-mod lazy;
|
||||
|
@ -367,11 +367,12 @@ index a1002fd..3a00ffe 100644
|
||||
impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
let n = Read::read(&mut self.fill_buf()?, buf)?;
|
||||
@@ -219,7 +210,6 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
@@ -219,7 +210,7 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
}
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature = "collections")]
|
||||
impl<T> BufRead for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn fill_buf(&mut self) -> io::Result<&[u8]> {
|
||||
let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64);
|
||||
@ -383,19 +384,21 @@ index a1002fd..3a00ffe 100644
|
||||
impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn write(&mut self, data: &[u8]) -> io::Result<usize> {
|
||||
let pos = cmp::min(self.pos, self.inner.len() as u64);
|
||||
@@ -239,7 +228,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
@@ -239,7 +228,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature="collections")]
|
||||
impl Write for Cursor<Vec<u8>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
// Make sure the internal buffer is as least as big as where we
|
||||
@@ -267,7 +255,6 @@ impl Write for Cursor<Vec<u8>> {
|
||||
@@ -267,7 +255,7 @@ impl Write for Cursor<Vec<u8>> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "cursor_box_slice", since = "1.5.0")]
|
||||
+#[cfg(feature="alloc")]
|
||||
impl Write for Cursor<Box<[u8]>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
let pos = cmp::min(self.pos, self.inner.len() as u64);
|
||||
@ -1030,7 +1033,7 @@ index a058337..d190cba 100644
|
||||
-mod buffered;
|
||||
-mod cursor;
|
||||
+#[cfg(feature="collections")] mod buffered;
|
||||
+#[cfg(feature="collections")] mod cursor;
|
||||
+mod cursor;
|
||||
mod error;
|
||||
mod impls;
|
||||
-mod lazy;
|
||||
|
@ -367,11 +367,12 @@ index a1002fd..3a00ffe 100644
|
||||
impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
let n = Read::read(&mut self.fill_buf()?, buf)?;
|
||||
@@ -219,7 +210,6 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
@@ -219,7 +210,7 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
}
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature = "collections")]
|
||||
impl<T> BufRead for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn fill_buf(&mut self) -> io::Result<&[u8]> {
|
||||
let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64);
|
||||
@ -383,19 +384,21 @@ index a1002fd..3a00ffe 100644
|
||||
impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn write(&mut self, data: &[u8]) -> io::Result<usize> {
|
||||
let pos = cmp::min(self.pos, self.inner.len() as u64);
|
||||
@@ -239,7 +228,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
@@ -239,7 +228,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature="collections")]
|
||||
impl Write for Cursor<Vec<u8>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
// Make sure the internal buffer is as least as big as where we
|
||||
@@ -267,7 +255,6 @@ impl Write for Cursor<Vec<u8>> {
|
||||
@@ -267,7 +255,7 @@ impl Write for Cursor<Vec<u8>> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "cursor_box_slice", since = "1.5.0")]
|
||||
+#[cfg(feature="alloc")]
|
||||
impl Write for Cursor<Box<[u8]>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
let pos = cmp::min(self.pos, self.inner.len() as u64);
|
||||
@ -1030,7 +1033,7 @@ index d914d14..d17f3cf 100644
|
||||
-mod buffered;
|
||||
-mod cursor;
|
||||
+#[cfg(feature="collections")] mod buffered;
|
||||
+#[cfg(feature="collections")] mod cursor;
|
||||
+mod cursor;
|
||||
mod error;
|
||||
mod impls;
|
||||
-mod lazy;
|
||||
|
@ -367,11 +367,12 @@ index 2d78055..1db50ee 100644
|
||||
impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
let n = Read::read(&mut self.fill_buf()?, buf)?;
|
||||
@@ -219,7 +210,6 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
@@ -219,7 +210,7 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
}
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature = "collections")]
|
||||
impl<T> BufRead for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn fill_buf(&mut self) -> io::Result<&[u8]> {
|
||||
let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64);
|
||||
@ -383,19 +384,21 @@ index 2d78055..1db50ee 100644
|
||||
impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
#[inline]
|
||||
fn write(&mut self, data: &[u8]) -> io::Result<usize> {
|
||||
@@ -240,7 +229,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
@@ -240,7 +229,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature="collections")]
|
||||
impl Write for Cursor<Vec<u8>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
// Make sure the internal buffer is as least as big as where we
|
||||
@@ -268,7 +256,6 @@ impl Write for Cursor<Vec<u8>> {
|
||||
@@ -268,7 +256,7 @@ impl Write for Cursor<Vec<u8>> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "cursor_box_slice", since = "1.5.0")]
|
||||
+#[cfg(feature="alloc")]
|
||||
impl Write for Cursor<Box<[u8]>> {
|
||||
#[inline]
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
@ -1030,7 +1033,7 @@ index a058337..d190cba 100644
|
||||
-mod buffered;
|
||||
-mod cursor;
|
||||
+#[cfg(feature="collections")] mod buffered;
|
||||
+#[cfg(feature="collections")] mod cursor;
|
||||
+mod cursor;
|
||||
mod error;
|
||||
mod impls;
|
||||
-mod lazy;
|
||||
|
@ -367,11 +367,12 @@ index a1002fd..3a00ffe 100644
|
||||
impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
let n = Read::read(&mut self.fill_buf()?, buf)?;
|
||||
@@ -219,7 +210,6 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
@@ -219,7 +210,7 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
}
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature = "collections")]
|
||||
impl<T> BufRead for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn fill_buf(&mut self) -> io::Result<&[u8]> {
|
||||
let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64);
|
||||
@ -383,19 +384,21 @@ index a1002fd..3a00ffe 100644
|
||||
impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn write(&mut self, data: &[u8]) -> io::Result<usize> {
|
||||
let pos = cmp::min(self.pos, self.inner.len() as u64);
|
||||
@@ -239,7 +228,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
@@ -239,7 +228,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature="collections")]
|
||||
impl Write for Cursor<Vec<u8>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
// Make sure the internal buffer is as least as big as where we
|
||||
@@ -267,7 +255,6 @@ impl Write for Cursor<Vec<u8>> {
|
||||
@@ -267,7 +255,7 @@ impl Write for Cursor<Vec<u8>> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "cursor_box_slice", since = "1.5.0")]
|
||||
+#[cfg(feature="alloc")]
|
||||
impl Write for Cursor<Box<[u8]>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
let pos = cmp::min(self.pos, self.inner.len() as u64);
|
||||
@ -1030,7 +1033,7 @@ index bcce8ee..4a492d7 100644
|
||||
-mod buffered;
|
||||
-mod cursor;
|
||||
+#[cfg(feature="collections")] mod buffered;
|
||||
+#[cfg(feature="collections")] mod cursor;
|
||||
+mod cursor;
|
||||
mod error;
|
||||
mod impls;
|
||||
-mod lazy;
|
||||
|
@ -367,11 +367,12 @@ index a1002fd..3a00ffe 100644
|
||||
impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
let n = Read::read(&mut self.fill_buf()?, buf)?;
|
||||
@@ -219,7 +210,6 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
@@ -219,7 +210,7 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
}
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature = "collections")]
|
||||
impl<T> BufRead for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn fill_buf(&mut self) -> io::Result<&[u8]> {
|
||||
let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64);
|
||||
@ -383,19 +384,21 @@ index a1002fd..3a00ffe 100644
|
||||
impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn write(&mut self, data: &[u8]) -> io::Result<usize> {
|
||||
let pos = cmp::min(self.pos, self.inner.len() as u64);
|
||||
@@ -239,7 +228,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
@@ -239,7 +228,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature="collections")]
|
||||
impl Write for Cursor<Vec<u8>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
// Make sure the internal buffer is as least as big as where we
|
||||
@@ -267,7 +255,6 @@ impl Write for Cursor<Vec<u8>> {
|
||||
@@ -267,7 +255,7 @@ impl Write for Cursor<Vec<u8>> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "cursor_box_slice", since = "1.5.0")]
|
||||
+#[cfg(feature="alloc")]
|
||||
impl Write for Cursor<Box<[u8]>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
let pos = cmp::min(self.pos, self.inner.len() as u64);
|
||||
@ -1030,7 +1033,7 @@ index 28492b3..924d626 100644
|
||||
-mod buffered;
|
||||
-mod cursor;
|
||||
+#[cfg(feature="collections")] mod buffered;
|
||||
+#[cfg(feature="collections")] mod cursor;
|
||||
+mod cursor;
|
||||
mod error;
|
||||
mod impls;
|
||||
-mod lazy;
|
||||
|
@ -366,11 +366,12 @@ index ae0085f..5392880 100644
|
||||
impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
let n = Read::read(&mut self.fill_buf()?, buf)?;
|
||||
@@ -219,7 +211,6 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
@@ -219,7 +211,7 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
}
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature = "collections")]
|
||||
impl<T> BufRead for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn fill_buf(&mut self) -> io::Result<&[u8]> {
|
||||
let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64);
|
||||
@ -382,19 +383,21 @@ index ae0085f..5392880 100644
|
||||
impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
#[inline]
|
||||
fn write(&mut self, data: &[u8]) -> io::Result<usize> {
|
||||
@@ -240,7 +230,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
@@ -240,7 +230,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature="collections")]
|
||||
impl Write for Cursor<Vec<u8>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
let pos: usize = self.position().try_into().map_err(|_| {
|
||||
@@ -270,7 +259,6 @@ impl Write for Cursor<Vec<u8>> {
|
||||
@@ -270,7 +259,7 @@ impl Write for Cursor<Vec<u8>> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "cursor_box_slice", since = "1.5.0")]
|
||||
+#[cfg(feature="alloc")]
|
||||
impl Write for Cursor<Box<[u8]>> {
|
||||
#[inline]
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
@ -938,7 +941,7 @@ index 7310564..05d91fc 100644
|
||||
-mod buffered;
|
||||
-mod cursor;
|
||||
+#[cfg(feature="collections")] mod buffered;
|
||||
+#[cfg(feature="collections")] mod cursor;
|
||||
+mod cursor;
|
||||
mod error;
|
||||
mod impls;
|
||||
-mod lazy;
|
||||
|
@ -367,11 +367,12 @@ index a1002fd..3a00ffe 100644
|
||||
impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
let n = Read::read(&mut self.fill_buf()?, buf)?;
|
||||
@@ -219,7 +210,6 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
@@ -219,7 +210,7 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
}
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature = "collections")]
|
||||
impl<T> BufRead for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn fill_buf(&mut self) -> io::Result<&[u8]> {
|
||||
let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64);
|
||||
@ -383,19 +384,21 @@ index a1002fd..3a00ffe 100644
|
||||
impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn write(&mut self, data: &[u8]) -> io::Result<usize> {
|
||||
let pos = cmp::min(self.pos, self.inner.len() as u64);
|
||||
@@ -239,7 +228,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
@@ -239,7 +228,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature="collections")]
|
||||
impl Write for Cursor<Vec<u8>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
// Make sure the internal buffer is as least as big as where we
|
||||
@@ -267,7 +255,6 @@ impl Write for Cursor<Vec<u8>> {
|
||||
@@ -267,7 +255,7 @@ impl Write for Cursor<Vec<u8>> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "cursor_box_slice", since = "1.5.0")]
|
||||
+#[cfg(feature="alloc")]
|
||||
impl Write for Cursor<Box<[u8]>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
let pos = cmp::min(self.pos, self.inner.len() as u64);
|
||||
@ -1030,7 +1033,7 @@ index a058337..d190cba 100644
|
||||
-mod buffered;
|
||||
-mod cursor;
|
||||
+#[cfg(feature="collections")] mod buffered;
|
||||
+#[cfg(feature="collections")] mod cursor;
|
||||
+mod cursor;
|
||||
mod error;
|
||||
mod impls;
|
||||
-mod lazy;
|
||||
|
@ -367,11 +367,12 @@ index 2d78055..1db50ee 100644
|
||||
impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
let n = Read::read(&mut self.fill_buf()?, buf)?;
|
||||
@@ -219,7 +210,6 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
@@ -219,7 +210,7 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
}
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature = "collections")]
|
||||
impl<T> BufRead for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn fill_buf(&mut self) -> io::Result<&[u8]> {
|
||||
let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64);
|
||||
@ -383,19 +384,21 @@ index 2d78055..1db50ee 100644
|
||||
impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
#[inline]
|
||||
fn write(&mut self, data: &[u8]) -> io::Result<usize> {
|
||||
@@ -240,7 +229,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
@@ -240,7 +229,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature="collections")]
|
||||
impl Write for Cursor<Vec<u8>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
// Make sure the internal buffer is as least as big as where we
|
||||
@@ -268,7 +256,6 @@ impl Write for Cursor<Vec<u8>> {
|
||||
@@ -268,7 +256,7 @@ impl Write for Cursor<Vec<u8>> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "cursor_box_slice", since = "1.5.0")]
|
||||
+#[cfg(feature="alloc")]
|
||||
impl Write for Cursor<Box<[u8]>> {
|
||||
#[inline]
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
@ -1036,7 +1039,7 @@ index d5b255e..c14c50e 100644
|
||||
-mod buffered;
|
||||
-mod cursor;
|
||||
+#[cfg(feature="collections")] mod buffered;
|
||||
+#[cfg(feature="collections")] mod cursor;
|
||||
+mod cursor;
|
||||
mod error;
|
||||
mod impls;
|
||||
-mod lazy;
|
||||
|
@ -367,11 +367,12 @@ index 2d78055..1db50ee 100644
|
||||
impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
let n = Read::read(&mut self.fill_buf()?, buf)?;
|
||||
@@ -219,7 +210,6 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
@@ -219,7 +210,7 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
}
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature = "collections")]
|
||||
impl<T> BufRead for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn fill_buf(&mut self) -> io::Result<&[u8]> {
|
||||
let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64);
|
||||
@ -383,19 +384,21 @@ index 2d78055..1db50ee 100644
|
||||
impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
#[inline]
|
||||
fn write(&mut self, data: &[u8]) -> io::Result<usize> {
|
||||
@@ -240,7 +229,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
@@ -240,7 +229,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature="collections")]
|
||||
impl Write for Cursor<Vec<u8>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
// Make sure the internal buffer is as least as big as where we
|
||||
@@ -268,7 +256,6 @@ impl Write for Cursor<Vec<u8>> {
|
||||
@@ -268,7 +256,7 @@ impl Write for Cursor<Vec<u8>> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "cursor_box_slice", since = "1.5.0")]
|
||||
+#[cfg(feature="alloc")]
|
||||
impl Write for Cursor<Box<[u8]>> {
|
||||
#[inline]
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
@ -1036,7 +1039,7 @@ index a058337..d190cba 100644
|
||||
-mod buffered;
|
||||
-mod cursor;
|
||||
+#[cfg(feature="collections")] mod buffered;
|
||||
+#[cfg(feature="collections")] mod cursor;
|
||||
+mod cursor;
|
||||
mod error;
|
||||
mod impls;
|
||||
-mod lazy;
|
||||
|
@ -365,11 +365,12 @@ index 1b836b7..c77f287 100644
|
||||
impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
let n = Read::read(&mut self.fill_buf()?, buf)?;
|
||||
@@ -218,7 +210,6 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
@@ -218,7 +210,7 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
}
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature = "collections")]
|
||||
impl<T> BufRead for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn fill_buf(&mut self) -> io::Result<&[u8]> {
|
||||
let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64);
|
||||
@ -381,19 +382,21 @@ index 1b836b7..c77f287 100644
|
||||
impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
#[inline]
|
||||
fn write(&mut self, data: &[u8]) -> io::Result<usize> {
|
||||
@@ -239,7 +229,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
@@ -239,7 +229,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature="collections")]
|
||||
impl Write for Cursor<Vec<u8>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
// Make sure the internal buffer is as least as big as where we
|
||||
@@ -267,7 +256,6 @@ impl Write for Cursor<Vec<u8>> {
|
||||
@@ -267,7 +256,7 @@ impl Write for Cursor<Vec<u8>> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "cursor_box_slice", since = "1.5.0")]
|
||||
+#[cfg(feature="alloc")]
|
||||
impl Write for Cursor<Box<[u8]>> {
|
||||
#[inline]
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
@ -1028,7 +1031,7 @@ index 1053792..5acfe6a 100644
|
||||
-mod buffered;
|
||||
-mod cursor;
|
||||
+#[cfg(feature="collections")] mod buffered;
|
||||
+#[cfg(feature="collections")] mod cursor;
|
||||
+mod cursor;
|
||||
mod error;
|
||||
mod impls;
|
||||
-mod lazy;
|
||||
|
@ -367,11 +367,12 @@ index a1002fd..3a00ffe 100644
|
||||
impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
let n = Read::read(&mut self.fill_buf()?, buf)?;
|
||||
@@ -219,7 +210,6 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
@@ -219,7 +210,7 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
}
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature = "collections")]
|
||||
impl<T> BufRead for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn fill_buf(&mut self) -> io::Result<&[u8]> {
|
||||
let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64);
|
||||
@ -383,19 +384,21 @@ index a1002fd..3a00ffe 100644
|
||||
impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn write(&mut self, data: &[u8]) -> io::Result<usize> {
|
||||
let pos = cmp::min(self.pos, self.inner.len() as u64);
|
||||
@@ -239,7 +228,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
@@ -239,7 +228,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature="collections")]
|
||||
impl Write for Cursor<Vec<u8>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
// Make sure the internal buffer is as least as big as where we
|
||||
@@ -267,7 +255,6 @@ impl Write for Cursor<Vec<u8>> {
|
||||
@@ -267,7 +255,7 @@ impl Write for Cursor<Vec<u8>> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "cursor_box_slice", since = "1.5.0")]
|
||||
+#[cfg(feature="alloc")]
|
||||
impl Write for Cursor<Box<[u8]>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
let pos = cmp::min(self.pos, self.inner.len() as u64);
|
||||
@ -1030,7 +1033,7 @@ index a058337..d190cba 100644
|
||||
-mod buffered;
|
||||
-mod cursor;
|
||||
+#[cfg(feature="collections")] mod buffered;
|
||||
+#[cfg(feature="collections")] mod cursor;
|
||||
+mod cursor;
|
||||
mod error;
|
||||
mod impls;
|
||||
-mod lazy;
|
||||
|
@ -367,11 +367,12 @@ index a1002fd..3a00ffe 100644
|
||||
impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
let n = Read::read(&mut self.fill_buf()?, buf)?;
|
||||
@@ -219,7 +210,6 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
@@ -219,7 +210,7 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
}
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature = "collections")]
|
||||
impl<T> BufRead for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn fill_buf(&mut self) -> io::Result<&[u8]> {
|
||||
let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64);
|
||||
@ -383,19 +384,21 @@ index a1002fd..3a00ffe 100644
|
||||
impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn write(&mut self, data: &[u8]) -> io::Result<usize> {
|
||||
let pos = cmp::min(self.pos, self.inner.len() as u64);
|
||||
@@ -239,7 +228,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
@@ -239,7 +228,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature="collections")]
|
||||
impl Write for Cursor<Vec<u8>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
// Make sure the internal buffer is as least as big as where we
|
||||
@@ -267,7 +255,6 @@ impl Write for Cursor<Vec<u8>> {
|
||||
@@ -267,7 +255,7 @@ impl Write for Cursor<Vec<u8>> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "cursor_box_slice", since = "1.5.0")]
|
||||
+#[cfg(feature="alloc")]
|
||||
impl Write for Cursor<Box<[u8]>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
let pos = cmp::min(self.pos, self.inner.len() as u64);
|
||||
@ -1030,7 +1033,7 @@ index ca15aa2..900ee2f 100644
|
||||
-mod buffered;
|
||||
-mod cursor;
|
||||
+#[cfg(feature="collections")] mod buffered;
|
||||
+#[cfg(feature="collections")] mod cursor;
|
||||
+mod cursor;
|
||||
mod error;
|
||||
mod impls;
|
||||
-mod lazy;
|
||||
|
@ -367,11 +367,12 @@ index 420fede..670e362 100644
|
||||
impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
let n = try!(Read::read(&mut try!(self.fill_buf()), buf));
|
||||
@@ -219,7 +210,6 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
@@ -219,7 +210,7 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
}
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature = "collections")]
|
||||
impl<T> BufRead for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn fill_buf(&mut self) -> io::Result<&[u8]> {
|
||||
let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64);
|
||||
@ -383,19 +384,21 @@ index 420fede..670e362 100644
|
||||
impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn write(&mut self, data: &[u8]) -> io::Result<usize> {
|
||||
let pos = cmp::min(self.pos, self.inner.len() as u64);
|
||||
@@ -239,7 +228,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
@@ -239,7 +228,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature="collections")]
|
||||
impl Write for Cursor<Vec<u8>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
// Make sure the internal buffer is as least as big as where we
|
||||
@@ -267,7 +255,6 @@ impl Write for Cursor<Vec<u8>> {
|
||||
@@ -267,7 +255,7 @@ impl Write for Cursor<Vec<u8>> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "cursor_box_slice", since = "1.5.0")]
|
||||
+#[cfg(feature="alloc")]
|
||||
impl Write for Cursor<Box<[u8]>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
let pos = cmp::min(self.pos, self.inner.len() as u64);
|
||||
@ -1038,7 +1041,7 @@ index 61334f3..9d9263f 100644
|
||||
-mod buffered;
|
||||
-mod cursor;
|
||||
+#[cfg(feature="collections")] mod buffered;
|
||||
+#[cfg(feature="collections")] mod cursor;
|
||||
+mod cursor;
|
||||
mod error;
|
||||
mod impls;
|
||||
-mod lazy;
|
||||
|
@ -367,11 +367,12 @@ index a1002fd..3a00ffe 100644
|
||||
impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
let n = Read::read(&mut self.fill_buf()?, buf)?;
|
||||
@@ -219,7 +210,6 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
@@ -219,7 +210,7 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
}
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature = "collections")]
|
||||
impl<T> BufRead for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn fill_buf(&mut self) -> io::Result<&[u8]> {
|
||||
let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64);
|
||||
@ -383,19 +384,21 @@ index a1002fd..3a00ffe 100644
|
||||
impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn write(&mut self, data: &[u8]) -> io::Result<usize> {
|
||||
let pos = cmp::min(self.pos, self.inner.len() as u64);
|
||||
@@ -239,7 +228,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
@@ -239,7 +228,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature="collections")]
|
||||
impl Write for Cursor<Vec<u8>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
// Make sure the internal buffer is as least as big as where we
|
||||
@@ -267,7 +255,6 @@ impl Write for Cursor<Vec<u8>> {
|
||||
@@ -267,7 +255,7 @@ impl Write for Cursor<Vec<u8>> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "cursor_box_slice", since = "1.5.0")]
|
||||
+#[cfg(feature="alloc")]
|
||||
impl Write for Cursor<Box<[u8]>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
let pos = cmp::min(self.pos, self.inner.len() as u64);
|
||||
@ -1030,7 +1033,7 @@ index a058337..d190cba 100644
|
||||
-mod buffered;
|
||||
-mod cursor;
|
||||
+#[cfg(feature="collections")] mod buffered;
|
||||
+#[cfg(feature="collections")] mod cursor;
|
||||
+mod cursor;
|
||||
mod error;
|
||||
mod impls;
|
||||
-mod lazy;
|
||||
|
@ -367,11 +367,12 @@ index 420fede..670e362 100644
|
||||
impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
let n = try!(Read::read(&mut try!(self.fill_buf()), buf));
|
||||
@@ -219,7 +210,6 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
@@ -219,7 +210,7 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
}
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature = "collections")]
|
||||
impl<T> BufRead for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn fill_buf(&mut self) -> io::Result<&[u8]> {
|
||||
let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64);
|
||||
@ -383,19 +384,21 @@ index 420fede..670e362 100644
|
||||
impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn write(&mut self, data: &[u8]) -> io::Result<usize> {
|
||||
let pos = cmp::min(self.pos, self.inner.len() as u64);
|
||||
@@ -239,7 +228,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
@@ -239,7 +228,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature="collections")]
|
||||
impl Write for Cursor<Vec<u8>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
// Make sure the internal buffer is as least as big as where we
|
||||
@@ -267,7 +255,6 @@ impl Write for Cursor<Vec<u8>> {
|
||||
@@ -267,7 +255,7 @@ impl Write for Cursor<Vec<u8>> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "cursor_box_slice", since = "1.5.0")]
|
||||
+#[cfg(feature="alloc")]
|
||||
impl Write for Cursor<Box<[u8]>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
let pos = cmp::min(self.pos, self.inner.len() as u64);
|
||||
@ -1030,7 +1033,7 @@ index 60a720e..85ce207 100644
|
||||
-mod buffered;
|
||||
-mod cursor;
|
||||
+#[cfg(feature="collections")] mod buffered;
|
||||
+#[cfg(feature="collections")] mod cursor;
|
||||
+mod cursor;
|
||||
mod error;
|
||||
mod impls;
|
||||
-mod lazy;
|
||||
|
@ -365,11 +365,12 @@ index 1b836b7..c77f287 100644
|
||||
impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
let n = Read::read(&mut self.fill_buf()?, buf)?;
|
||||
@@ -218,7 +210,6 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
@@ -218,7 +210,7 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
}
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature = "collections")]
|
||||
impl<T> BufRead for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn fill_buf(&mut self) -> io::Result<&[u8]> {
|
||||
let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64);
|
||||
@ -381,19 +382,21 @@ index 1b836b7..c77f287 100644
|
||||
impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
#[inline]
|
||||
fn write(&mut self, data: &[u8]) -> io::Result<usize> {
|
||||
@@ -239,7 +229,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
@@ -239,7 +229,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature="collections")]
|
||||
impl Write for Cursor<Vec<u8>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
// Make sure the internal buffer is as least as big as where we
|
||||
@@ -267,7 +256,6 @@ impl Write for Cursor<Vec<u8>> {
|
||||
@@ -267,7 +256,7 @@ impl Write for Cursor<Vec<u8>> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "cursor_box_slice", since = "1.5.0")]
|
||||
+#[cfg(feature="alloc")]
|
||||
impl Write for Cursor<Box<[u8]>> {
|
||||
#[inline]
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
@ -937,7 +940,7 @@ index 3becc0a..05d91fc 100644
|
||||
-mod buffered;
|
||||
-mod cursor;
|
||||
+#[cfg(feature="collections")] mod buffered;
|
||||
+#[cfg(feature="collections")] mod cursor;
|
||||
+mod cursor;
|
||||
mod error;
|
||||
mod impls;
|
||||
-mod lazy;
|
||||
|
@ -367,11 +367,12 @@ index 2d78055..1db50ee 100644
|
||||
impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
let n = Read::read(&mut self.fill_buf()?, buf)?;
|
||||
@@ -219,7 +210,6 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
@@ -219,7 +210,7 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
}
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature = "collections")]
|
||||
impl<T> BufRead for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn fill_buf(&mut self) -> io::Result<&[u8]> {
|
||||
let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64);
|
||||
@ -383,19 +384,21 @@ index 2d78055..1db50ee 100644
|
||||
impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
#[inline]
|
||||
fn write(&mut self, data: &[u8]) -> io::Result<usize> {
|
||||
@@ -240,7 +229,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
@@ -240,7 +229,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature="collections")]
|
||||
impl Write for Cursor<Vec<u8>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
// Make sure the internal buffer is as least as big as where we
|
||||
@@ -268,7 +256,6 @@ impl Write for Cursor<Vec<u8>> {
|
||||
@@ -268,7 +256,7 @@ impl Write for Cursor<Vec<u8>> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "cursor_box_slice", since = "1.5.0")]
|
||||
+#[cfg(feature="alloc")]
|
||||
impl Write for Cursor<Box<[u8]>> {
|
||||
#[inline]
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
@ -1036,7 +1039,7 @@ index a058337..d190cba 100644
|
||||
-mod buffered;
|
||||
-mod cursor;
|
||||
+#[cfg(feature="collections")] mod buffered;
|
||||
+#[cfg(feature="collections")] mod cursor;
|
||||
+mod cursor;
|
||||
mod error;
|
||||
mod impls;
|
||||
-mod lazy;
|
||||
|
@ -365,11 +365,12 @@ index 1b836b7..c77f287 100644
|
||||
impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
let n = Read::read(&mut self.fill_buf()?, buf)?;
|
||||
@@ -218,7 +210,6 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
@@ -218,7 +210,7 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
}
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature = "collections")]
|
||||
impl<T> BufRead for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn fill_buf(&mut self) -> io::Result<&[u8]> {
|
||||
let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64);
|
||||
@ -381,19 +382,21 @@ index 1b836b7..c77f287 100644
|
||||
impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
#[inline]
|
||||
fn write(&mut self, data: &[u8]) -> io::Result<usize> {
|
||||
@@ -239,7 +229,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
@@ -239,7 +229,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature="collections")]
|
||||
impl Write for Cursor<Vec<u8>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
// Make sure the internal buffer is as least as big as where we
|
||||
@@ -267,7 +256,6 @@ impl Write for Cursor<Vec<u8>> {
|
||||
@@ -267,7 +256,7 @@ impl Write for Cursor<Vec<u8>> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "cursor_box_slice", since = "1.5.0")]
|
||||
+#[cfg(feature="alloc")]
|
||||
impl Write for Cursor<Box<[u8]>> {
|
||||
#[inline]
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
@ -1029,7 +1032,7 @@ index 06609cf..a1bbe50 100644
|
||||
-mod buffered;
|
||||
-mod cursor;
|
||||
+#[cfg(feature="collections")] mod buffered;
|
||||
+#[cfg(feature="collections")] mod cursor;
|
||||
+mod cursor;
|
||||
mod error;
|
||||
mod impls;
|
||||
-mod lazy;
|
||||
|
@ -367,11 +367,12 @@ index 2d78055..1db50ee 100644
|
||||
impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
let n = Read::read(&mut self.fill_buf()?, buf)?;
|
||||
@@ -219,7 +210,6 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
@@ -219,7 +210,7 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
}
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature = "collections")]
|
||||
impl<T> BufRead for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn fill_buf(&mut self) -> io::Result<&[u8]> {
|
||||
let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64);
|
||||
@ -383,19 +384,21 @@ index 2d78055..1db50ee 100644
|
||||
impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
#[inline]
|
||||
fn write(&mut self, data: &[u8]) -> io::Result<usize> {
|
||||
@@ -240,7 +229,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
@@ -240,7 +229,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature="collections")]
|
||||
impl Write for Cursor<Vec<u8>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
// Make sure the internal buffer is as least as big as where we
|
||||
@@ -268,7 +256,6 @@ impl Write for Cursor<Vec<u8>> {
|
||||
@@ -268,7 +256,7 @@ impl Write for Cursor<Vec<u8>> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "cursor_box_slice", since = "1.5.0")]
|
||||
+#[cfg(feature="alloc")]
|
||||
impl Write for Cursor<Box<[u8]>> {
|
||||
#[inline]
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
@ -1030,7 +1033,7 @@ index a058337..d190cba 100644
|
||||
-mod buffered;
|
||||
-mod cursor;
|
||||
+#[cfg(feature="collections")] mod buffered;
|
||||
+#[cfg(feature="collections")] mod cursor;
|
||||
+mod cursor;
|
||||
mod error;
|
||||
mod impls;
|
||||
-mod lazy;
|
||||
|
@ -365,11 +365,12 @@ index 1b836b7..c77f287 100644
|
||||
impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
let n = Read::read(&mut self.fill_buf()?, buf)?;
|
||||
@@ -218,7 +210,6 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
@@ -218,7 +210,7 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
}
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature = "collections")]
|
||||
impl<T> BufRead for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn fill_buf(&mut self) -> io::Result<&[u8]> {
|
||||
let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64);
|
||||
@ -381,19 +382,21 @@ index 1b836b7..c77f287 100644
|
||||
impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
#[inline]
|
||||
fn write(&mut self, data: &[u8]) -> io::Result<usize> {
|
||||
@@ -239,7 +229,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
@@ -239,7 +229,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature="collections")]
|
||||
impl Write for Cursor<Vec<u8>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
// Make sure the internal buffer is as least as big as where we
|
||||
@@ -267,7 +256,6 @@ impl Write for Cursor<Vec<u8>> {
|
||||
@@ -267,7 +256,7 @@ impl Write for Cursor<Vec<u8>> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "cursor_box_slice", since = "1.5.0")]
|
||||
+#[cfg(feature="alloc")]
|
||||
impl Write for Cursor<Box<[u8]>> {
|
||||
#[inline]
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
@ -1029,7 +1032,7 @@ index 06609cf..a1bbe50 100644
|
||||
-mod buffered;
|
||||
-mod cursor;
|
||||
+#[cfg(feature="collections")] mod buffered;
|
||||
+#[cfg(feature="collections")] mod cursor;
|
||||
+mod cursor;
|
||||
mod error;
|
||||
mod impls;
|
||||
-mod lazy;
|
||||
|
@ -367,11 +367,12 @@ index 2d78055..1db50ee 100644
|
||||
impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
let n = Read::read(&mut self.fill_buf()?, buf)?;
|
||||
@@ -219,7 +210,6 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
@@ -219,7 +210,7 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
}
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature = "collections")]
|
||||
impl<T> BufRead for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn fill_buf(&mut self) -> io::Result<&[u8]> {
|
||||
let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64);
|
||||
@ -383,19 +384,21 @@ index 2d78055..1db50ee 100644
|
||||
impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
#[inline]
|
||||
fn write(&mut self, data: &[u8]) -> io::Result<usize> {
|
||||
@@ -240,7 +229,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
@@ -240,7 +229,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature="collections")]
|
||||
impl Write for Cursor<Vec<u8>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
// Make sure the internal buffer is as least as big as where we
|
||||
@@ -268,7 +256,6 @@ impl Write for Cursor<Vec<u8>> {
|
||||
@@ -268,7 +256,7 @@ impl Write for Cursor<Vec<u8>> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "cursor_box_slice", since = "1.5.0")]
|
||||
+#[cfg(feature="alloc")]
|
||||
impl Write for Cursor<Box<[u8]>> {
|
||||
#[inline]
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
@ -1044,7 +1047,7 @@ index 307d014..3f9472c 100644
|
||||
-mod buffered;
|
||||
-mod cursor;
|
||||
+#[cfg(feature="collections")] mod buffered;
|
||||
+#[cfg(feature="collections")] mod cursor;
|
||||
+mod cursor;
|
||||
mod error;
|
||||
mod impls;
|
||||
-mod lazy;
|
||||
|
@ -367,11 +367,12 @@ index 420fede..670e362 100644
|
||||
impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
let n = try!(Read::read(&mut try!(self.fill_buf()), buf));
|
||||
@@ -219,7 +210,6 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
@@ -219,7 +210,7 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
}
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature = "collections")]
|
||||
impl<T> BufRead for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn fill_buf(&mut self) -> io::Result<&[u8]> {
|
||||
let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64);
|
||||
@ -383,19 +384,22 @@ index 420fede..670e362 100644
|
||||
impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn write(&mut self, data: &[u8]) -> io::Result<usize> {
|
||||
let pos = cmp::min(self.pos, self.inner.len() as u64);
|
||||
@@ -239,7 +228,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
@@ -239,7 +228,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[cfg(feature="collections")]
|
||||
+#[cfg(feature="collections")]
|
||||
impl Write for Cursor<Vec<u8>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
// Make sure the internal buffer is as least as big as where we
|
||||
@@ -267,7 +255,6 @@ impl Write for Cursor<Vec<u8>> {
|
||||
@@ -267,7 +255,7 @@ impl Write for Cursor<Vec<u8>> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "cursor_box_slice", since = "1.5.0")]
|
||||
+#[cfg(feature="alloc")]
|
||||
impl Write for Cursor<Box<[u8]>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
let pos = cmp::min(self.pos, self.inner.len() as u64);
|
||||
@ -1038,7 +1042,7 @@ index 61334f3..9d9263f 100644
|
||||
-mod buffered;
|
||||
-mod cursor;
|
||||
+#[cfg(feature="collections")] mod buffered;
|
||||
+#[cfg(feature="collections")] mod cursor;
|
||||
+mod cursor;
|
||||
mod error;
|
||||
mod impls;
|
||||
-mod lazy;
|
||||
|
@ -367,11 +367,12 @@ index 2d78055..1db50ee 100644
|
||||
impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
let n = Read::read(&mut self.fill_buf()?, buf)?;
|
||||
@@ -219,7 +210,6 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
@@ -219,7 +210,7 @@ impl<T> Read for Cursor<T> where T: AsRef<[u8]> {
|
||||
}
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature = "collections")]
|
||||
impl<T> BufRead for Cursor<T> where T: AsRef<[u8]> {
|
||||
fn fill_buf(&mut self) -> io::Result<&[u8]> {
|
||||
let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64);
|
||||
@ -383,19 +384,21 @@ index 2d78055..1db50ee 100644
|
||||
impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
#[inline]
|
||||
fn write(&mut self, data: &[u8]) -> io::Result<usize> {
|
||||
@@ -240,7 +229,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
@@ -240,7 +229,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "rust1", since = "1.0.0")]
|
||||
+#[cfg(feature="collections")]
|
||||
impl Write for Cursor<Vec<u8>> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
// Make sure the internal buffer is as least as big as where we
|
||||
@@ -268,7 +256,6 @@ impl Write for Cursor<Vec<u8>> {
|
||||
@@ -268,7 +256,7 @@ impl Write for Cursor<Vec<u8>> {
|
||||
fn flush(&mut self) -> io::Result<()> { Ok(()) }
|
||||
}
|
||||
|
||||
-#[stable(feature = "cursor_box_slice", since = "1.5.0")]
|
||||
+#[cfg(feature="alloc")]
|
||||
impl Write for Cursor<Box<[u8]>> {
|
||||
#[inline]
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
@ -1044,7 +1047,7 @@ index 88fd418..94508d2 100644
|
||||
-mod buffered;
|
||||
-mod cursor;
|
||||
+#[cfg(feature="collections")] mod buffered;
|
||||
+#[cfg(feature="collections")] mod cursor;
|
||||
+mod cursor;
|
||||
mod error;
|
||||
mod impls;
|
||||
-mod lazy;
|
||||
|
Loading…
Reference in New Issue
Block a user