martin-g commented on code in PR #438:
URL: https://github.com/apache/avro-rs/pull/438#discussion_r2727326213
##########
avro/examples/specific_single_object.rs:
##########
@@ -32,24 +33,29 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
};
let mut writer = SpecificSingleObjectWriter::<Test>::with_capacity(1024)?;
- match writer.write(test.clone(), &mut buffer) {
- Ok(bytes_written) => {
- assert_eq!(bytes_written, 15);
- assert_eq!(
- buffer,
- vec![
- 195, 1, 166, 59, 243, 49, 82, 230, 8, 161, 54, 6, 102,
111, 111
- ]
- );
- }
- Err(err) => {
- panic!("Error during serialization: {err:?}");
+ let reader = SpecificSingleObjectReader::<Test>::new()?;
+
+ for test in repeat(test).take(2) {
Review Comment:
```suggestion
for test in repeat_n(test, 2) {
```
##########
avro/examples/specific_single_object.rs:
##########
@@ -17,6 +17,7 @@
use apache_avro::{AvroSchema, SpecificSingleObjectReader,
SpecificSingleObjectWriter};
use serde::{Deserialize, Serialize};
+use std::iter::repeat;
Review Comment:
```suggestion
use std::iter::repeat_n;
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]