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
14 changes: 12 additions & 2 deletions avro/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,18 @@ pub enum Details {
#[error("Unions may not directly contain a union")]
GetNestedUnion,

#[error("Unions cannot contain duplicate types")]
GetUnionDuplicate,
#[error(
"Found two different maps while building Union: Schema::Map({0:?}), Schema::Map({1:?})"
)]
GetUnionDuplicateMap(Schema, Schema),

#[error(
"Found two different arrays while building Union: Schema::Array({0:?}), Schema::Array({1:?})"
)]
GetUnionDuplicateArray(Schema, Schema),

#[error("Unions cannot contain duplicate types, found at least two {0:?}")]
GetUnionDuplicate(SchemaKind),

#[error("Unions cannot contain more than one named schema with the same name: {0}")]
GetUnionDuplicateNamedSchemas(String),
Expand Down
2 changes: 1 addition & 1 deletion avro/src/schema/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub use crate::schema::{
RecordField, RecordFieldBuilder, RecordFieldOrder, RecordSchema, RecordSchemaBuilder,
},
resolve::ResolvedSchema,
union::UnionSchema,
union::{UnionSchema, UnionSchemaBuilder},
};
use crate::{
AvroResult,
Expand Down
2 changes: 1 addition & 1 deletion avro/src/schema/name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use crate::{
///
/// More information about schema names can be found in the
/// [Avro specification](https://avro.apache.org/docs/++version++/specification/#names)
#[derive(Clone, Debug, Hash, PartialEq, Eq)]
#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub struct Name {
pub name: String,
pub namespace: Namespace,
Expand Down
Loading