You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by kr...@apache.org on 2026/02/25 20:59:26 UTC
(avro-rs) 06/07: fix: Use `Write::write_all` in `utils::encode_variable`
This is an automated email from the ASF dual-hosted git repository.
kriskras99 pushed a commit to branch fix/small_things
in repository https://gitbox.apache.org/repos/asf/avro-rs.git
commit 7ce2e389d490c2181e3b1354a54bd0a4ffb0dcbd
Author: Kriskras99 <gi...@kriskras99.nl>
AuthorDate: Wed Feb 25 21:54:57 2026 +0100
fix: Use `Write::write_all` in `utils::encode_variable`
---
avro/src/util.rs | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/avro/src/util.rs b/avro/src/util.rs
index 8acbfa4..3127f8d 100644
--- a/avro/src/util.rs
+++ b/avro/src/util.rs
@@ -127,8 +127,9 @@ fn encode_variable<W: Write>(mut zigzagged: u64, mut writer: W) -> AvroResult<us
}
}
writer
- .write(&buffer[..i])
- .map_err(|e| Details::WriteBytes(e).into())
+ .write_all(&buffer[..i])
+ .map_err(Details::WriteBytes)?;
+ Ok(i)
}
/// Read a varint from the reader.