Jefffrey commented on code in PR #10407:
URL: https://github.com/apache/arrow-rs/pull/10407#discussion_r3635690131


##########
arrow-avro/src/reader/vlq.rs:
##########
@@ -29,19 +31,30 @@ pub struct VLQDecoder {
 
 impl VLQDecoder {
     /// Decode a signed long from `buf`
-    pub fn long(&mut self, buf: &mut &[u8]) -> Option<i64> {
+    ///
+    /// Returns `Err` if `buf` starts with more than 10 continuation bytes 
without a

Review Comment:
   this docstring is slightly misleading as if `VLQDecoder` is already 
inprogress it might not take 10 continuation bytes from `buf` to cause an error



##########
arrow-avro/src/reader/vlq.rs:
##########
@@ -29,19 +31,30 @@ pub struct VLQDecoder {
 
 impl VLQDecoder {
     /// Decode a signed long from `buf`
-    pub fn long(&mut self, buf: &mut &[u8]) -> Option<i64> {
+    ///
+    /// Returns `Err` if `buf` starts with more than 10 continuation bytes 
without a
+    /// terminator, which would otherwise overflow the accumulated `u64` 
(matching the
+    /// bound already enforced by [`read_varint_array`] for the stateless 
decoders below).

Review Comment:
   ```suggestion
       /// terminator, which would otherwise overflow the accumulated `i64`.
   ```
   
   we don't really need this detail
   
   also refer to `i64` since that is what we are decoding (regardless of how 
internally we hold it as `u64`)



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

Reply via email to