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

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


The following commit(s) were added to refs/heads/main by this push:
     new 6e6da17  chore: Small fixes including one nightly Clippy lint (#513)
6e6da17 is described below

commit 6e6da17ade56087ed10b2064ef6817d90196f6a8
Author: Kriskras99 <[email protected]>
AuthorDate: Sun Mar 22 12:15:38 2026 +0100

    chore: Small fixes including one nightly Clippy lint (#513)
---
 avro/src/schema/builders.rs      | 6 ++----
 avro/src/schema/mod.rs           | 5 ++---
 avro/tests/append_to_existing.rs | 4 +---
 avro/tests/avro-rs-219.rs        | 1 -
 4 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/avro/src/schema/builders.rs b/avro/src/schema/builders.rs
index e1b8c21..9f9923a 100644
--- a/avro/src/schema/builders.rs
+++ b/avro/src/schema/builders.rs
@@ -100,13 +100,11 @@ impl Schema {
     #[builder(finish_fn = build)]
     pub fn record(
         #[builder(start_fn)] name: Name,
-        fields: Option<Vec<RecordField>>,
+        #[builder(default)] fields: Vec<RecordField>,
         aliases: Option<Vec<Alias>>,
         doc: Option<String>,
-        attributes: Option<BTreeMap<String, JsonValue>>,
+        #[builder(default)] attributes: BTreeMap<String, JsonValue>,
     ) -> Self {
-        let fields = fields.unwrap_or_default();
-        let attributes = attributes.unwrap_or_default();
         let record_schema = RecordSchema::builder()
             .name(name)
             .fields(fields)
diff --git a/avro/src/schema/mod.rs b/avro/src/schema/mod.rs
index 40476cb..446f781 100644
--- a/avro/src/schema/mod.rs
+++ b/avro/src/schema/mod.rs
@@ -413,9 +413,9 @@ impl FixedSchema {
 #[derive(Debug, Clone)]
 pub struct DecimalSchema {
     /// The number of digits in the unscaled value
-    pub precision: DecimalMetadata,
+    pub precision: Precision,
     /// The number of digits to the right of the decimal point
-    pub scale: DecimalMetadata,
+    pub scale: Scale,
     /// The inner schema of the decimal (fixed or bytes)
     pub inner: InnerDecimalSchema,
 }
@@ -4861,7 +4861,6 @@ mod tests {
             _ => panic!("Expected ArraySchema. got: {}", &schema1),
         }
         let canonical_form1 = schema1.canonical_form();
-        println!("Canonical Form 1: {}", &canonical_form1);
         let schema2 = Schema::parse_str(&canonical_form1)?;
         let canonical_form2 = schema2.canonical_form();
 
diff --git a/avro/tests/append_to_existing.rs b/avro/tests/append_to_existing.rs
index ef5723e..571c05c 100644
--- a/avro/tests/append_to_existing.rs
+++ b/avro/tests/append_to_existing.rs
@@ -46,10 +46,8 @@ fn avro_3630_append_to_an_existing_file() -> TestResult {
     let new_bytes = writer.into_inner().expect("Cannot get the new bytes");
 
     let reader = Reader::new(&*new_bytes).expect("Cannot read the new bytes");
-    let mut i = 1;
-    for value in reader {
+    for (i, value) in (1..).zip(reader) {
         check(&value, i);
-        i += 1
     }
 
     Ok(())
diff --git a/avro/tests/avro-rs-219.rs b/avro/tests/avro-rs-219.rs
index 34d503f..5e96a3e 100644
--- a/avro/tests/avro-rs-219.rs
+++ b/avro/tests/avro-rs-219.rs
@@ -38,6 +38,5 @@ fn 
avro_rs_219_failing_deserialization_due_to_bigdecimal_dependency() {
     }"#;
 
     let result = serde_json::from_str::<S3>(test);
-    println!("result : {result:#?}");
     result.unwrap();
 }

Reply via email to