1
Fork 0

More implementations of Write for immutable refs

Fixes #73836
This commit is contained in:
Federico Ponzi 2020-09-02 23:25:09 +02:00
parent fe8ab8a530
commit 28db5214d2
No known key found for this signature in database
GPG key ID: CFA9CCFE5363D0C6
3 changed files with 97 additions and 0 deletions

View file

@ -262,6 +262,25 @@ impl Write for ChildStdin {
}
}
#[stable(feature = "write_mt", since = "1.47.0")]
impl Write for &ChildStdin {
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
self.inner.write(buf)
}
fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
self.inner.write_vectored(bufs)
}
fn is_write_vectored(&self) -> bool {
self.inner.is_write_vectored()
}
fn flush(&mut self) -> io::Result<()> {
Ok(())
}
}
impl AsInner<AnonPipe> for ChildStdin {
fn as_inner(&self) -> &AnonPipe {
&self.inner