You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by GitBox <gi...@apache.org> on 2022/10/18 06:31:10 UTC

[GitHub] [avro] davidpeklak commented on a diff in pull request #1914: AVRO-3642: [RUST] Fix GenericSingleObjectReader::read_value for non-exhaustive reads

davidpeklak commented on code in PR #1914:
URL: https://github.com/apache/avro/pull/1914#discussion_r997769175


##########
lang/rust/avro/src/reader.rs:
##########
@@ -396,9 +396,9 @@ impl GenericSingleObjectReader {
 
     pub fn read_value<R: Read>(&self, reader: &mut R) -> AvroResult<Value> {
         let mut header: [u8; 10] = [0; 10];
-        match reader.read(&mut header) {
-            Ok(size) => {
-                if size == 10 && self.expected_header == header {
+        match reader.read_exact(&mut header) {
+            Ok(_) => {

Review Comment:
   `reader.read_exact` returns `Result<()>`, so it is not possible to match to 10 here.



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org