Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions embedded-io-async/src/impls/slice_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,9 @@ impl Write for &mut [u8] {
*self = b;
Ok(amt)
}

#[inline]
async fn flush(&mut self) -> Result<(), Self::Error> {
Ok(())
}
}
5 changes: 5 additions & 0 deletions embedded-io-async/src/impls/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@ impl Write for Vec<u8> {
self.extend_from_slice(buf);
Ok(buf.len())
}

#[inline]
async fn flush(&mut self) -> Result<(), Self::Error> {
Ok(())
}
}
4 changes: 1 addition & 3 deletions embedded-io-async/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,7 @@ pub trait Write: ErrorType {
async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error>;

/// Flush this output stream, ensuring that all intermediately buffered contents reach their destination.
async fn flush(&mut self) -> Result<(), Self::Error> {
Ok(())
}
async fn flush(&mut self) -> Result<(), Self::Error>;

/// Write an entire buffer into this writer.
///
Expand Down