1
Fork 0

Rollup merge of #76275 - FedericoPonzi:immutable-write-impl-73836, r=dtolnay

Implementation of Write for some immutable ref structs

Fixes  #73836
This commit is contained in:
ecstatic-morse 2020-09-21 20:40:44 -07:00 committed by GitHub
commit 65bdf79da3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 97 additions and 0 deletions

View file

@ -249,6 +249,25 @@ pub struct ChildStdin {
#[stable(feature = "process", since = "1.0.0")]
impl Write for ChildStdin {
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
(&*self).write(buf)
}
fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
(&*self).write_vectored(bufs)
}
fn is_write_vectored(&self) -> bool {
io::Write::is_write_vectored(&&*self)
}
fn flush(&mut self) -> io::Result<()> {
(&*self).flush()
}
}
#[stable(feature = "write_mt", since = "1.48.0")]
impl Write for &ChildStdin {
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
self.inner.write(buf)
}