AVRO-3600: UnionSchema::new method should be public (#1817)
* AVRO-3600: UnionSchema::new method should be public
UnionSchema::new method should be public to facility programmatic schema
creation. Visibility of the method changed.
* AVRO-3600: Add rustdoc to a method that has been promoted to be public
Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
Co-authored-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
diff --git a/lang/rust/avro/src/schema.rs b/lang/rust/avro/src/schema.rs
index d8759fd..e96b16d 100644
--- a/lang/rust/avro/src/schema.rs
+++ b/lang/rust/avro/src/schema.rs
@@ -629,7 +629,8 @@
}
impl UnionSchema {
- pub(crate) fn new(schemas: Vec<Schema>) -> AvroResult<Self> {
+ /// Creates a new UnionSchema from a vector of schemas.
+ pub fn new(schemas: Vec<Schema>) -> AvroResult<Self> {
let mut vindex = BTreeMap::new();
for (i, schema) in schemas.iter().enumerate() {
if let Schema::Union(_) = schema {