Kriskras99 commented on issue #574:
URL: https://github.com/apache/avro-rs/issues/574#issuecomment-4886747260
How about this? Then a separate function is not needed and we can reuse the
type in different places too.
```rust
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)
--
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]