eyalleshem commented on a change in pull request #7384: URL: https://github.com/apache/arrow/pull/7384#discussion_r438898154
########## File path: rust/arrow/src/ipc/reader.rs ########## @@ -793,7 +793,21 @@ impl<R: Read> StreamReader<R> { } // determine metadata length let mut meta_size: [u8; 4] = [0; 4]; - self.reader.read_exact(&mut meta_size)?; + + match self.reader.read_exact(&mut meta_size) { + Ok(()) => (), + Err(e) => { + if e.kind() == std::io::ErrorKind::UnexpectedEof { + // Handle EOF without the "0xFFFFFFFF 0x00000000" + // valid according to: + // https://arrow.apache.org/docs/format/Columnar.html#ipc-streaming-format + self.finished = true; + return Ok(None); + } + return Err(ArrowError::from(e)); Review comment: I don't think that i could remove return , As it's not the last statement of the function . for example i tried this : ``` if let Err(e) = self.reader.read_exact(&mut meta_size) { if e.kind() == std::io::ErrorKind::UnexpectedEof { // Handle EOF without the "0xFFFFFFFF 0x00000000" // valid according to: // https://arrow.apache.org/docs/format/Columnar.html#ipc-streaming-format self.finished = true; Ok(None) } else { Err(ArrowError::from(e)) ``` } } } but the complier complain : `expected `()`, found enum `std::result::Result`` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org