This is an automated email from the ASF dual-hosted git repository.
mgrigorov pushed a commit to branch avro-3904-schema-compatibility-improvements
in repository https://gitbox.apache.org/repos/asf/avro.git
The following commit(s) were added to
refs/heads/avro-3904-schema-compatibility-improvements by this push:
new 3575d2624 AVRO-3904: [Rust] Use `Debug` instead of `Display` when
printing schemata in CompatibilityError
3575d2624 is described below
commit 3575d26243840062cc16673156bcb8e8fda51a8b
Author: Martin Tzvetanov Grigorov <[email protected]>
AuthorDate: Mon Dec 4 11:33:18 2023 +0200
AVRO-3904: [Rust] Use `Debug` instead of `Display` when printing schemata
in CompatibilityError
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
---
lang/rust/avro/src/schema.rs | 4 ++--
lang/rust/avro/src/schema_compatibility.rs | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/lang/rust/avro/src/schema.rs b/lang/rust/avro/src/schema.rs
index 23320509e..f2487e316 100644
--- a/lang/rust/avro/src/schema.rs
+++ b/lang/rust/avro/src/schema.rs
@@ -35,7 +35,7 @@ use std::{
io::Read,
str::FromStr,
};
-use strum_macros::{Display, EnumDiscriminants, EnumString};
+use strum_macros::{EnumDiscriminants, EnumString};
lazy_static! {
static ref ENUM_SYMBOL_NAME_R: Regex =
Regex::new(r"^[A-Za-z_][A-Za-z0-9_]*$").unwrap();
@@ -73,7 +73,7 @@ impl fmt::Display for SchemaFingerprint {
/// Represents any valid Avro schema
/// More information about Avro schemas can be found in the
/// [Avro
Specification](https://avro.apache.org/docs/current/spec.html#schemas)
-#[derive(Clone, Debug, Display, EnumDiscriminants)]
+#[derive(Clone, Debug, EnumDiscriminants)]
#[strum_discriminants(name(SchemaKind), derive(Hash, Ord, PartialOrd))]
pub enum Schema {
/// A `null` Avro schema.
diff --git a/lang/rust/avro/src/schema_compatibility.rs
b/lang/rust/avro/src/schema_compatibility.rs
index 0cf713bb4..46c4d4e02 100644
--- a/lang/rust/avro/src/schema_compatibility.rs
+++ b/lang/rust/avro/src/schema_compatibility.rs
@@ -73,8 +73,8 @@ impl Checker {
match readers_schema {
Schema::Map(r_m) => self.full_match_schemas(w_m, r_m),
_ => Err(CompatibilityError::WrongType {
- writer_schema_type: format!("{}", writers_schema),
- reader_schema_type: format!("{}", readers_schema),
+ writer_schema_type: format!("{:#?}",
writers_schema),
+ reader_schema_type: format!("{:#?}",
readers_schema),
}),
}
} else {
@@ -89,8 +89,8 @@ impl Checker {
match readers_schema {
Schema::Array(r_a) => self.full_match_schemas(w_a,
r_a),
_ => Err(CompatibilityError::WrongType {
- writer_schema_type: format!("{}", writers_schema),
- reader_schema_type: format!("{}", readers_schema),
+ writer_schema_type: format!("{:#?}",
writers_schema),
+ reader_schema_type: format!("{:#?}",
readers_schema),
}),
}
} else {