Skip to content

Commit 023849d

Browse files
committed
chore: explicit result type
1 parent 44f4fbc commit 023849d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/read/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ pub trait Read {
278278
fn read(&mut self, buf: &mut [u8]) -> Result<usize>;
279279

280280
/// Read the exact number of bytes required to fill `buf`.
281-
fn read_exact(&mut self, buf: &mut [u8]) -> Result {
281+
fn read_exact(&mut self, buf: &mut [u8]) -> Result<()> {
282282
default_read_exact(self, buf)
283283
}
284284

src/write/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ pub trait Write {
5858

5959
/// Flush this output stream, ensuring that all intermediately buffered
6060
/// contents reach their destination.
61-
fn flush(&mut self) -> Result;
61+
fn flush(&mut self) -> Result<()>;
6262

6363
/// Attempts to write an entire buffer into this writer.
64-
fn write_all(&mut self, mut buf: &[u8]) -> Result {
64+
fn write_all(&mut self, mut buf: &[u8]) -> Result<()> {
6565
while !buf.is_empty() {
6666
match self.write(buf) {
6767
Ok(0) => return Err(Error::WriteZero),

0 commit comments

Comments
 (0)