fn ensure_eof(mut reader: impl Read) -> Result<(), ParseCartridgeError> {
            let mut buf = 0u8;
            if reader.read(slice::from_mut(&mut buf))? == 0 {
                // zero bytes read = EOF.
                Ok(())
            } else {
                Err(ParseCartridgeError::ExtraData)
            }
        }
/// Tries to read one more byte to make sure the reader is actually at EOF.
Tries to read one more byte to make sure the reader is actually at EOF.
Tries to read one more byte to make sure the reader is actually at EOF .
fn ensure_eof(mut reader: impl Read) -> Result<(), ParseCartridgeError> {
            let mut buf = 0u8;
            if reader.read(slice::from_mut(&mut buf))? == 0 {
                // zero bytes read = EOF.
                Ok(())
            } else {
                Err(ParseCartridgeError::ExtraData)
            }
        }
fn ensure_eof ( mut reader : impl Read ) -> Result < ( ) , ParseCartridgeError > { let mut buf = 0u8 ; if reader . read ( slice :: from_mut ( & mut buf ) ) ? == 0 { // zero bytes read = EOF. Ok ( ( ) ) } else { Err ( ParseCartridgeError :: ExtraData ) } }
Tries to read one more byte to make sure the reader is actually at EOF.
Tries to read one more byte to make sure the reader is actually at EOF .
reader
impl Read
reader
impl Read