flxo commented on issue #574:
URL: https://github.com/apache/avro-rs/issues/574#issuecomment-4890254965

   > How about this? Then a separate function is not needed and we can reuse 
the type in different places too.
   > 
   > enum CowResolvedSchema<'s> {
   >     Owned(ResolvedOwnedSchema),
   >     Ref(ResolvedSchema<'s>,
   >     RefOwned(&'s ResolvedOwnedSchema)
   >     RefRef(&'s ResolvedSchema<'s>)
   > }
   > 
   > // Implement a bunch of Froms and TryFroms
   > 
   > // Now 
   > pub fn resolve(self, schema: S) -> AvroResult<Self> where 
   > S: TryInto<CowResolvedSchema>,
   > <S as TryInto>::Error: Into<AvroError>;
   > 
   > // No changes here
   > pub fn resolve_schemata(self, schema: &Schema, schemata: Vec<&Schema>) -> 
AvroResult<Self>;
   > (Example code not actually checked with the compiler)
   
   Thanks for addressing this. 
   
   Wouldn't a trait fit in here compared to the enum? 
   


-- 
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