Kriskras99 commented on code in PR #246:
URL: https://github.com/apache/avro-rs/pull/246#discussion_r2272540675


##########
avro/src/types.rs:
##########
@@ -332,793 +319,931 @@ impl TryFrom<Value> for JsonValue {
                 .map(|(key, value)| Self::try_from(value).map(|v| (key, v)))
                 .collect::<Result<Vec<_>, _>>()
                 .map(|v| Self::Object(v.into_iter().collect())),
-            Value::Date(d) => Ok(Self::Number(d.into())),
+            Value::Date(d) => Ok(serde_json::Value::Number(d.into())),
             Value::Decimal(ref d) => <Vec<u8>>::try_from(d)
                 .map(|vec| Self::Array(vec.into_iter().map(|v| 
v.into()).collect())),
             Value::BigDecimal(ref bg) => {
-                let vec1: Vec<u8> = serialize_big_decimal(bg)?;
-                Ok(Self::Array(vec1.into_iter().map(|b| b.into()).collect()))
+                let vec1: Vec<u8> = 
crate::bigdecimal::sync::serialize_big_decimal(bg)?;

Review Comment:
   You can't. You need to add the `try_from` function to a regular `impl` block 
instead of implementing the trait. Or as you did, always use the sync version 
because you're writing to a Vec anyway.
   
   This is one of the reasons I separate the reading from creating the final 
output in my state machine implementation. 



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