Kriskras99 commented on code in PR #519:
URL: https://github.com/apache/avro-rs/pull/519#discussion_r3032848960


##########
avro/src/serde/derive.rs:
##########
@@ -590,11 +593,16 @@ where
         named_schemas: &mut HashSet<Name>,
         enclosing_namespace: NamespaceRef,
     ) -> Schema {
-        let variants = vec![
-            Schema::Null,
-            T::get_schema_in_ctxt(named_schemas, enclosing_namespace),
-        ];
-
+        let variants = match T::get_schema_in_ctxt(named_schemas, 
enclosing_namespace) {
+            Schema::Union(union) if 
union.index_of_schema_kind(SchemaKind::Null).is_some() => {
+                union.schemas

Review Comment:
   I think it's okay to have the panic. Any user of the trait will use their 
type in tests, so the panic should also always trigger in tests.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to