Deduplicates io::Write implementations
This commit is contained in:
parent
28db5214d2
commit
ec7f9b927f
2 changed files with 18 additions and 18 deletions
|
@ -584,26 +584,26 @@ impl fmt::Debug for Stdout {
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
impl Write for Stdout {
|
impl Write for Stdout {
|
||||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||||
self.lock().write(buf)
|
(&*self).write(buf)
|
||||||
}
|
}
|
||||||
fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
|
fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
|
||||||
self.lock().write_vectored(bufs)
|
(&*self).write_vectored(bufs)
|
||||||
}
|
}
|
||||||
#[inline]
|
#[inline]
|
||||||
fn is_write_vectored(&self) -> bool {
|
fn is_write_vectored(&self) -> bool {
|
||||||
self.lock().is_write_vectored()
|
io::Write::is_write_vectored(&&*self)
|
||||||
}
|
}
|
||||||
fn flush(&mut self) -> io::Result<()> {
|
fn flush(&mut self) -> io::Result<()> {
|
||||||
self.lock().flush()
|
(&*self).flush()
|
||||||
}
|
}
|
||||||
fn write_all(&mut self, buf: &[u8]) -> io::Result<()> {
|
fn write_all(&mut self, buf: &[u8]) -> io::Result<()> {
|
||||||
self.lock().write_all(buf)
|
(&*self).write_all(buf)
|
||||||
}
|
}
|
||||||
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> io::Result<()> {
|
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> io::Result<()> {
|
||||||
self.lock().write_all_vectored(bufs)
|
(&*self).write_all_vectored(bufs)
|
||||||
}
|
}
|
||||||
fn write_fmt(&mut self, args: fmt::Arguments<'_>) -> io::Result<()> {
|
fn write_fmt(&mut self, args: fmt::Arguments<'_>) -> io::Result<()> {
|
||||||
self.lock().write_fmt(args)
|
(&*self).write_fmt(args)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -787,26 +787,26 @@ impl fmt::Debug for Stderr {
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
impl Write for Stderr {
|
impl Write for Stderr {
|
||||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||||
self.lock().write(buf)
|
(&*self).write(buf)
|
||||||
}
|
}
|
||||||
fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
|
fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
|
||||||
self.lock().write_vectored(bufs)
|
(&*self).write_vectored(bufs)
|
||||||
}
|
}
|
||||||
#[inline]
|
#[inline]
|
||||||
fn is_write_vectored(&self) -> bool {
|
fn is_write_vectored(&self) -> bool {
|
||||||
self.lock().is_write_vectored()
|
io::Write::is_write_vectored(&&*self)
|
||||||
}
|
}
|
||||||
fn flush(&mut self) -> io::Result<()> {
|
fn flush(&mut self) -> io::Result<()> {
|
||||||
self.lock().flush()
|
(&*self).flush()
|
||||||
}
|
}
|
||||||
fn write_all(&mut self, buf: &[u8]) -> io::Result<()> {
|
fn write_all(&mut self, buf: &[u8]) -> io::Result<()> {
|
||||||
self.lock().write_all(buf)
|
(&*self).write_all(buf)
|
||||||
}
|
}
|
||||||
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> io::Result<()> {
|
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> io::Result<()> {
|
||||||
self.lock().write_all_vectored(bufs)
|
(&*self).write_all_vectored(bufs)
|
||||||
}
|
}
|
||||||
fn write_fmt(&mut self, args: fmt::Arguments<'_>) -> io::Result<()> {
|
fn write_fmt(&mut self, args: fmt::Arguments<'_>) -> io::Result<()> {
|
||||||
self.lock().write_fmt(args)
|
(&*self).write_fmt(args)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -246,19 +246,19 @@ pub struct ChildStdin {
|
||||||
#[stable(feature = "process", since = "1.0.0")]
|
#[stable(feature = "process", since = "1.0.0")]
|
||||||
impl Write for ChildStdin {
|
impl Write for ChildStdin {
|
||||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||||
self.inner.write(buf)
|
(&*self).write(buf)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
|
fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
|
||||||
self.inner.write_vectored(bufs)
|
(&*self).write_vectored(bufs)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn is_write_vectored(&self) -> bool {
|
fn is_write_vectored(&self) -> bool {
|
||||||
self.inner.is_write_vectored()
|
io::Write::is_write_vectored(&&*self)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn flush(&mut self) -> io::Result<()> {
|
fn flush(&mut self) -> io::Result<()> {
|
||||||
Ok(())
|
(&*self).flush()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue