You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by GitBox <gi...@apache.org> on 2022/11/10 19:48:14 UTC

[GitHub] [avro] martin-g commented on a diff in pull request #1950: AVRO-3664: [rust] Add Rust Avro Value conversion derive implementations

martin-g commented on code in PR #1950:
URL: https://github.com/apache/avro/pull/1950#discussion_r1019539110


##########
lang/rust/avro/src/error.rs:
##########
@@ -238,6 +244,9 @@ pub enum Error {
     #[error("JSON value {0} claims to be i64 but cannot be converted")]
     GetI64FromJson(serde_json::Number),
 
+    #[error("Failed to convert from type to apache_avro::types::Value")]

Review Comment:
   The type (`0`) should be printed with the message



##########
lang/rust/avro_derive/src/lib.rs:
##########
@@ -139,9 +226,9 @@ fn get_data_struct_schema_def(
                     Some(default_value) => {
                         let _: serde_json::Value = serde_json::from_str(&default_value[..])
                             .map_err(|e| {
-                                vec![Error::new(
+                                vec![syn::Error::new(
                                     field.ident.span(),
-                                    format!("Invalid avro default json: \n{}", e),
+                                    format!("Invalid avro default json: \n{e}"),

Review Comment:
   The minimum supported version (1.54) does not support this syntax.



-- 
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: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org