changeset 14266 | 1b8c889027a3 |
parent 14265 | f0c0d2d217c3 |
child 14277 | 3152d9fdb499 |
--- a/rust/lib-hedgewars-engine/src/ipc.rs Wed Nov 21 15:49:16 2018 +0100 +++ b/rust/lib-hedgewars-engine/src/ipc.rs Wed Nov 21 15:52:17 2018 +0100 @@ -32,13 +32,11 @@ impl Read for IPC { fn read(&mut self, buf: &mut [u8]) -> Result<usize> { - let result = self.out_buffer.as_ref().read(buf); + let read_bytes = self.out_buffer.as_ref().read(buf)?; - if let Ok(read_bytes) = result { - self.out_buffer.consume(read_bytes); - } + self.out_buffer.consume(read_bytes); - result + Ok(read_bytes) } }