Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test-lang-rust-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- 'stable'
- 'beta'
- 'nightly'
- '1.86.0' # MSRV
- '1.88.0' # MSRV
runner:
- name: ubuntu-24.04
target: x86_64-unknown-linux-gnu
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-lang-rust-clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
matrix:
rust:
- 'stable'
- '1.86.0' # MSRV
- '1.88.0' # MSRV
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ version = "0.22.0"
license = "Apache-2.0"
repository = "https://github.com/apache/avro-rs"
edition = "2024"
rust-version = "1.86.0"
rust-version = "1.88.0"
keywords = ["avro", "data", "serialization"]
categories = ["encoding"]
documentation = "https://docs.rs/apache-avro"
Expand Down
2 changes: 1 addition & 1 deletion avro/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ versions. If you have troubles upgrading, check the release notes.

## Minimum supported Rust version

1.86.0
1.88.0

## Defining a schema

Expand Down
17 changes: 15 additions & 2 deletions avro/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -611,15 +611,28 @@ pub enum CompatibilityError {
#[error("Incompatible schemata! Field '{0}' in reader schema must have a default value")]
MissingDefaultValue(String),

#[error("Incompatible schemata! Reader's symbols must contain all writer's symbols")]
#[error("Incompatible schemata! Reader's symbols contain none of the writer's symbols")]
MissingSymbols,

#[error("Incompatible schemata! All elements in union must match for both schemas")]
MissingUnionElements,

#[error("Incompatible schemata! Name and size don't match for fixed")]
#[error("Incompatible schemata! At least one element in the union must match the schema")]
SchemaMismatchAllUnionElements,

#[error("Incompatible schemata! Size doesn't match for fixed")]
FixedMismatch,

#[error(
"Incompatible schemata! Decimal precision and/or scale don't match, reader: ({r_precision},{r_scale}), writer: ({w_precision},{w_scale})"
)]
DecimalMismatch {
r_precision: usize,
r_scale: usize,
w_precision: usize,
w_scale: usize,
},

#[error(
"Incompatible schemata! The name must be the same for both schemas. Writer's name {writer_name} and reader's name {reader_name}"
)]
Expand Down
2 changes: 1 addition & 1 deletion avro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
//!
//! # Minimum supported Rust version
//!
//! 1.86.0
//! 1.88.0
//!
//! # Defining a schema
//!
Expand Down
34 changes: 17 additions & 17 deletions avro/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1853,10 +1853,10 @@ impl Parser {
) -> AvroResult<Schema> {
let fields_opt = complex.get("fields");

if fields_opt.is_none() {
if let Some(seen) = self.get_already_seen_schema(complex, enclosing_namespace) {
return Ok(seen.clone());
}
if fields_opt.is_none()
&& let Some(seen) = self.get_already_seen_schema(complex, enclosing_namespace)
{
return Ok(seen.clone());
}

let fully_qualified_name = Name::parse(complex, enclosing_namespace)?;
Expand Down Expand Up @@ -1932,10 +1932,10 @@ impl Parser {
) -> AvroResult<Schema> {
let symbols_opt = complex.get("symbols");

if symbols_opt.is_none() {
if let Some(seen) = self.get_already_seen_schema(complex, enclosing_namespace) {
return Ok(seen.clone());
}
if symbols_opt.is_none()
&& let Some(seen) = self.get_already_seen_schema(complex, enclosing_namespace)
{
return Ok(seen.clone());
}

let fully_qualified_name = Name::parse(complex, enclosing_namespace)?;
Expand Down Expand Up @@ -2075,10 +2075,10 @@ impl Parser {
enclosing_namespace: &Namespace,
) -> AvroResult<Schema> {
let size_opt = complex.get("size");
if size_opt.is_none() {
if let Some(seen) = self.get_already_seen_schema(complex, enclosing_namespace) {
return Ok(seen.clone());
}
if size_opt.is_none()
&& let Some(seen) = self.get_already_seen_schema(complex, enclosing_namespace)
{
return Ok(seen.clone());
}

let doc = complex.get("doc").and_then(|v| match &v {
Expand Down Expand Up @@ -2449,11 +2449,11 @@ fn pcf_map(schema: &Map<String, Value>, defined_names: &mut HashSet<String>) ->
}

// Fully qualify the name, if it isn't already ([FULLNAMES] rule).
if k == "name" {
if let Some(ref n) = name {
fields.push(("name", format!("{}:{}", pcf_string(k), pcf_string(n))));
continue;
}
if k == "name"
&& let Some(ref n) = name
{
fields.push(("name", format!("{}:{}", pcf_string(k), pcf_string(n))));
continue;
}

// Strip off quotes surrounding "size" type, if they exist ([INTEGERS] rule).
Expand Down
Loading
Loading