diff --git a/lang/rust/avro_derive/tests/derive.rs b/lang/rust/avro_derive/tests/derive.rs index 0bfc9a95cf1..89488b7e577 100644 --- a/lang/rust/avro_derive/tests/derive.rs +++ b/lang/rust/avro_derive/tests/derive.rs @@ -68,8 +68,8 @@ mod test_derive { { assert!(!encoded.is_empty()); let schema = T::get_schema(); - let reader = Reader::with_schema(&schema, &encoded[..]).unwrap(); - for res in reader { + let mut reader = Reader::with_schema(&schema, &encoded[..]).unwrap(); + if let Some(res) = reader.next() { match res { Ok(value) => { return from_value::(&value).unwrap();