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 1583c8e feat: Accept more inputs for
Schema::independent_canonical_form (#215)
1583c8e is described below
commit 1583c8e94386a5b824211b60f76b60d79c40fb22
Author: Kriskras99 <[email protected]>
AuthorDate: Thu Jun 26 12:11:26 2025 +0200
feat: Accept more inputs for Schema::independent_canonical_form (#215)
This is not a breaking change, as `&Vec<Schema>` will deref to
`&[Schema]`.
Co-authored-by: kriskras99 <[email protected]>
---
avro/src/schema.rs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/avro/src/schema.rs b/avro/src/schema.rs
index c7d2602..edb3345 100644
--- a/avro/src/schema.rs
+++ b/avro/src/schema.rs
@@ -1063,7 +1063,7 @@ impl Schema {
///
/// [Parsing Canonical Form]:
///
https://avro.apache.org/docs/current/specification/#parsing-canonical-form-for-schemas
- pub fn independent_canonical_form(&self, schemata: &Vec<Schema>) ->
Result<String, Error> {
+ pub fn independent_canonical_form(&self, schemata: &[Schema]) ->
Result<String, Error> {
let mut this = self.clone();
this.denormalize(schemata)?;
Ok(this.canonical_form())
@@ -1278,7 +1278,7 @@ impl Schema {
})
}
- fn denormalize(&mut self, schemata: &Vec<Schema>) -> AvroResult<()> {
+ fn denormalize(&mut self, schemata: &[Schema]) -> AvroResult<()> {
match self {
Schema::Ref { name } => {
let replacement_schema = schemata