martin-g commented on code in PR #230:
URL: https://github.com/apache/avro-rs/pull/230#discussion_r2219044160


##########
avro/src/decimal.rs:
##########
@@ -93,7 +93,7 @@ impl Decimal {
         let mut decimal_bytes = vec![sign_byte; len];
         let raw_bytes = self.value.to_signed_bytes_be();
         let num_raw_bytes = raw_bytes.len();
-        let start_byte_index = 
len.checked_sub(num_raw_bytes).ok_or(Error::SignExtend {
+        let start_byte_index = 
len.checked_sub(num_raw_bytes).ok_or(Details::SignExtend {

Review Comment:
   ok_or_else ?



##########
avro/src/bigdecimal.rs:
##########
@@ -50,27 +51,27 @@ pub(crate) fn deserialize_big_decimal(bytes: &Vec<u8>) -> 
AvroResult<BigDecimal>
     let mut bytes: &[u8] = bytes.as_slice();
     let mut big_decimal_buffer = match decode_len(&mut bytes) {
         Ok(size) => vec![0u8; size],
-        Err(err) => return Err(Error::BigDecimalLen(Box::new(err))),
+        Err(err) => return Err(Details::BigDecimalLen(Box::new(err)).into()),

Review Comment:
   We can drop the usage of Box here, right ?



##########
avro/src/codec.rs:
##########
@@ -91,7 +91,7 @@ impl Codec {
                 let mut encoded: Vec<u8> = vec![0; 
snap::raw::max_compress_len(stream.len())];
                 let compressed_size = snap::raw::Encoder::new()
                     .compress(&stream[..], &mut encoded[..])
-                    .map_err(Error::SnappyCompress)?;
+                    .map_err(Details::SnappyCompress)?;

Review Comment:
   How does this work without the `.into()` call ?



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