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 a18db98 chore: Fix clippy errors with Rust 1.90.1 (#330)
a18db98 is described below
commit a18db98865fc839c0f473921e1ea8f05f0916030
Author: Martin Grigorov <[email protected]>
AuthorDate: Thu Oct 30 23:08:51 2025 +0200
chore: Fix clippy errors with Rust 1.90.1 (#330)
Use an array instead of a Vec where possible
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
---
avro/src/de.rs | 2 +-
avro/src/schema.rs | 2 +-
avro/tests/io.rs | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/avro/src/de.rs b/avro/src/de.rs
index 92a3b68..551b434 100644
--- a/avro/src/de.rs
+++ b/avro/src/de.rs
@@ -1050,7 +1050,7 @@ mod tests {
Val4(u64),
}
- let data = vec![
+ let data = [
(
TestNullExternalEnum {
a: NullExternalEnum::Val1,
diff --git a/avro/src/schema.rs b/avro/src/schema.rs
index b8907e6..582e104 100644
--- a/avro/src/schema.rs
+++ b/avro/src/schema.rs
@@ -2565,7 +2565,7 @@ pub mod derive {
let inner_schema = T::get_schema_in_ctxt(named_schemas,
enclosing_namespace);
Schema::Union(UnionSchema {
schemas: vec![Schema::Null, inner_schema.clone()],
- variant_index: vec![Schema::Null, inner_schema]
+ variant_index: [Schema::Null, inner_schema]
.iter()
.enumerate()
.map(|(idx, s)| (SchemaKind::from(s), idx))
diff --git a/avro/tests/io.rs b/avro/tests/io.rs
index ef7dc2d..5284426 100644
--- a/avro/tests/io.rs
+++ b/avro/tests/io.rs
@@ -264,7 +264,7 @@ fn test_schema_promotion() -> TestResult {
// Each schema is present in order of promotion (int -> long, long ->
float, float -> double)
// Each value represents the expected decoded value when promoting a value
previously encoded with a promotable schema
let promotable_schemas = [r#""int""#, r#""long""#, r#""float""#,
r#""double""#];
- let promotable_values = vec![
+ let promotable_values = [
Value::Int(219),
Value::Long(219),
Value::Float(219.0),