You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by mg...@apache.org on 2022/10/14 08:43:06 UTC

[avro] branch master updated (3c4f5adcc -> 1027938c4)

This is an automated email from the ASF dual-hosted git repository.

mgrigorov pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/avro.git


    from 3c4f5adcc AVRO-3634: Implement AvroSchemaComponent for bool (#1906)
     new 63844f811 AVRO-3639: [Rust] Derive implementation for Eq where possible
     new 1027938c4 AVRO-3639: Add fleet.toml and .cargo/config.toml to gitignore

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 lang/rust/.gitignore                  |  2 ++
 lang/rust/avro/src/de.rs              | 24 +++++++++++-----------
 lang/rust/avro/src/reader.rs          |  2 +-
 lang/rust/avro_derive/tests/derive.rs | 38 +++++++++++++++++------------------
 4 files changed, 34 insertions(+), 32 deletions(-)


[avro] 01/02: AVRO-3639: [Rust] Derive implementation for Eq where possible

Posted by mg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mgrigorov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/avro.git

commit 63844f8114e6d1068ab8443f5fb988e56f28a277
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
AuthorDate: Fri Oct 14 11:39:30 2022 +0300

    AVRO-3639: [Rust] Derive implementation for Eq where possible
    
    Signed-off-by: Martin Tzvetanov Grigorov <mg...@apache.org>
---
 lang/rust/avro/src/de.rs              | 24 +++++++++++-----------
 lang/rust/avro/src/reader.rs          |  2 +-
 lang/rust/avro_derive/tests/derive.rs | 38 +++++++++++++++++------------------
 3 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/lang/rust/avro/src/de.rs b/lang/rust/avro/src/de.rs
index 6562e622e..83a09ebdc 100644
--- a/lang/rust/avro/src/de.rs
+++ b/lang/rust/avro/src/de.rs
@@ -599,59 +599,59 @@ mod tests {
 
     use super::*;
 
-    #[derive(Debug, Deserialize, Serialize, Clone, PartialEq)]
+    #[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
     struct Test {
         a: i64,
         b: String,
     }
 
-    #[derive(Debug, Deserialize, Serialize, PartialEq)]
+    #[derive(Debug, Deserialize, Serialize, PartialEq, Eq)]
     struct TestInner {
         a: Test,
         b: i32,
     }
 
-    #[derive(Debug, Deserialize, Serialize, PartialEq)]
+    #[derive(Debug, Deserialize, Serialize, PartialEq, Eq)]
     struct TestUnitExternalEnum {
         a: UnitExternalEnum,
     }
 
-    #[derive(Debug, Deserialize, Serialize, PartialEq)]
+    #[derive(Debug, Deserialize, Serialize, PartialEq, Eq)]
     enum UnitExternalEnum {
         Val1,
         Val2,
     }
 
-    #[derive(Debug, Deserialize, Serialize, PartialEq)]
+    #[derive(Debug, Deserialize, Serialize, PartialEq, Eq)]
     struct TestUnitInternalEnum {
         a: UnitInternalEnum,
     }
 
-    #[derive(Debug, Deserialize, Serialize, PartialEq)]
+    #[derive(Debug, Deserialize, Serialize, PartialEq, Eq)]
     #[serde(tag = "t")]
     enum UnitInternalEnum {
         Val1,
         Val2,
     }
 
-    #[derive(Debug, Deserialize, Serialize, PartialEq)]
+    #[derive(Debug, Deserialize, Serialize, PartialEq, Eq)]
     struct TestUnitAdjacentEnum {
         a: UnitAdjacentEnum,
     }
 
-    #[derive(Debug, Deserialize, Serialize, PartialEq)]
+    #[derive(Debug, Deserialize, Serialize, PartialEq, Eq)]
     #[serde(tag = "t", content = "v")]
     enum UnitAdjacentEnum {
         Val1,
         Val2,
     }
 
-    #[derive(Debug, Deserialize, Serialize, PartialEq)]
+    #[derive(Debug, Deserialize, Serialize, PartialEq, Eq)]
     struct TestUnitUntaggedEnum {
         a: UnitUntaggedEnum,
     }
 
-    #[derive(Debug, Deserialize, Serialize, PartialEq)]
+    #[derive(Debug, Deserialize, Serialize, PartialEq, Eq)]
     #[serde(untagged)]
     enum UnitUntaggedEnum {
         Val1,
@@ -918,12 +918,12 @@ mod tests {
         // AVRO-3232 test for deserialize_any on missing fields on the destination struct:
         // Error: DeserializeValue("Unsupported union")
         // Error: DeserializeValue("incorrect value of type: String")
-        #[derive(Debug, Deserialize, PartialEq)]
+        #[derive(Debug, Deserialize, PartialEq, Eq)]
         struct RecordInUnion {
             record_in_union: i32,
         }
 
-        #[derive(Debug, Deserialize, PartialEq)]
+        #[derive(Debug, Deserialize, PartialEq, Eq)]
         struct StructWithMissingFields {
             a_string: String,
             a_record: Option<RecordInUnion>,
diff --git a/lang/rust/avro/src/reader.rs b/lang/rust/avro/src/reader.rs
index a8238b226..a1dfffde9 100644
--- a/lang/rust/avro/src/reader.rs
+++ b/lang/rust/avro/src/reader.rs
@@ -559,7 +559,7 @@ mod tests {
       ]
     }
     "#;
-        #[derive(Default, Debug, Deserialize, PartialEq)]
+        #[derive(Default, Debug, Deserialize, PartialEq, Eq)]
         struct TestRecord3240 {
             a: i64,
             b: String,
diff --git a/lang/rust/avro_derive/tests/derive.rs b/lang/rust/avro_derive/tests/derive.rs
index cfbd30a44..6eccb0579 100644
--- a/lang/rust/avro_derive/tests/derive.rs
+++ b/lang/rust/avro_derive/tests/derive.rs
@@ -83,7 +83,7 @@ mod test_derive {
         unreachable!()
     }
 
-    #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq)]
+    #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq, Eq)]
     struct TestBasic {
         a: i32,
         b: String,
@@ -117,7 +117,7 @@ mod test_derive {
         serde_assert(test);
     }}
 
-    #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq)]
+    #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq, Eq)]
     #[avro(namespace = "com.testing.namespace")]
     struct TestBasicNamespace {
         a: i32,
@@ -151,7 +151,7 @@ mod test_derive {
         }
     }
 
-    #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq)]
+    #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq, Eq)]
     #[avro(namespace = "com.testing.complex.namespace")]
     struct TestComplexNamespace {
         a: TestBasicNamespace,
@@ -388,7 +388,7 @@ mod test_derive {
         serde_assert(inner_struct);
     }}
 
-    #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq)]
+    #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq, Eq)]
     struct TestOptional {
         a: Option<i32>,
     }
@@ -581,7 +581,7 @@ mod test_derive {
         serde_assert(test_generic);
     }}
 
-    #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq)]
+    #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq, Eq)]
     enum TestAllowedEnum {
         A,
         B,
@@ -589,7 +589,7 @@ mod test_derive {
         D,
     }
 
-    #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq)]
+    #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq, Eq)]
     struct TestAllowedEnumNested {
         a: TestAllowedEnum,
         b: String,
@@ -724,7 +724,7 @@ mod test_derive {
         serde_assert(list)
     }
 
-    #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq)]
+    #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq, Eq)]
     struct TestSimpleArray {
         a: [i32; 4],
     }
@@ -805,7 +805,7 @@ mod test_derive {
         serde_assert(test)
     }
 
-    #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq)]
+    #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq, Eq)]
     struct Testu8 {
         a: Vec<u8>,
         b: [u8; 2],
@@ -913,7 +913,7 @@ mod test_derive {
         ser(test);
     }}
 
-    #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq)]
+    #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq, Eq)]
     #[avro(namespace = "com.testing.namespace", doc = "A Documented Record")]
     struct TestBasicWithAttributes {
         #[avro(doc = "Milliseconds since Queen released Bohemian Rhapsody")]
@@ -953,7 +953,7 @@ mod test_derive {
         assert_eq!(schema, TestBasicWithAttributes::get_schema());
     }
 
-    #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq)]
+    #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq, Eq)]
     #[avro(namespace = "com.testing.namespace")]
     /// A Documented Record
     struct TestBasicWithOuterDocAttributes {
@@ -994,7 +994,7 @@ mod test_derive {
         assert_eq!(schema, TestBasicWithOuterDocAttributes::get_schema());
     }
 
-    #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq)]
+    #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq, Eq)]
     #[avro(namespace = "com.testing.namespace")]
     /// A Documented Record
     /// that spans
@@ -1040,7 +1040,7 @@ mod test_derive {
         assert_eq!(schema, TestBasicWithLargeDoc::get_schema());
     }
 
-    #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq)]
+    #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq, Eq)]
     struct TestBasicWithBool {
         a: bool,
         b: Option<bool>,
@@ -1078,7 +1078,7 @@ mod test_derive {
         serde_assert(TestBasicWithBool { a, b });
     }}
 
-    #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq)]
+    #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq, Eq)]
     struct TestBasicWithU32 {
         a: u32,
     }
@@ -1109,7 +1109,7 @@ mod test_derive {
         serde_assert(TestBasicWithU32 { a });
     }}
 
-    #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq)]
+    #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq, Eq)]
     #[avro(alias = "a", alias = "b", alias = "c")]
     struct TestBasicStructWithAliases {
         a: i32,
@@ -1149,7 +1149,7 @@ mod test_derive {
         serde_assert(TestBasicStructWithAliases { a: i32::MAX });
     }
 
-    #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq)]
+    #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq, Eq)]
     #[avro(alias = "d")]
     #[avro(alias = "e")]
     #[avro(alias = "f")]
@@ -1191,7 +1191,7 @@ mod test_derive {
         serde_assert(TestBasicStructWithAliases2 { a: i32::MAX });
     }
 
-    #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq)]
+    #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq, Eq)]
     #[avro(alias = "a", alias = "b", alias = "c")]
     enum TestBasicEnumWithAliases {
         A,
@@ -1230,7 +1230,7 @@ mod test_derive {
         serde_assert(TestBasicEnumWithAliases::A);
     }
 
-    #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq)]
+    #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq, Eq)]
     #[avro(alias = "d")]
     #[avro(alias = "e")]
     #[avro(alias = "f")]
@@ -1273,7 +1273,7 @@ mod test_derive {
 
     #[test]
     fn test_basic_struct_with_defaults() {
-        #[derive(Debug, Deserialize, Serialize, AvroSchema, Clone, PartialEq)]
+        #[derive(Debug, Deserialize, Serialize, AvroSchema, Clone, PartialEq, Eq)]
         enum MyEnum {
             Foo,
             Bar,
@@ -1406,7 +1406,7 @@ mod test_derive {
         // Note: If using the skip attribute together with serialization,
         // the serde's skip attribute needs also to be added
 
-        #[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
+        #[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq, Eq)]
         struct TestBasicStructNoSchema {
             field: bool,
         }


[avro] 02/02: AVRO-3639: Add fleet.toml and .cargo/config.toml to gitignore

Posted by mg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mgrigorov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/avro.git

commit 1027938c46ed3ae07ac7c23ecd0764bd357df23f
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
AuthorDate: Fri Oct 14 11:39:53 2022 +0300

    AVRO-3639: Add fleet.toml and .cargo/config.toml to gitignore
    
    We don't use .cargo/config.toml for anything custom for now!
    Using Jetbrains Fleet generates such files with its custom stuff inside.
    If we ever need to add custom and general Cargo config then we
    (developers) should stop using Fleet.
    
    Signed-off-by: Martin Tzvetanov Grigorov <mg...@apache.org>
---
 lang/rust/.gitignore | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lang/rust/.gitignore b/lang/rust/.gitignore
index 9ac07d707..875c6ff70 100644
--- a/lang/rust/.gitignore
+++ b/lang/rust/.gitignore
@@ -4,3 +4,5 @@
 .idea/
 *.iml
 precommit_venv/
+fleet.toml
+**/.cargo/config.toml