jecsand838 commented on code in PR #8242:
URL: https://github.com/apache/arrow-rs/pull/8242#discussion_r2308925748


##########
arrow-avro/src/schema.rs:
##########
@@ -478,15 +516,15 @@ pub struct SchemaStore {
     schemas: HashMap<Fingerprint, AvroSchema>,
 }
 
-impl TryFrom<&[AvroSchema]> for SchemaStore {
+impl TryFrom<&HashMap<Fingerprint, AvroSchema>> for SchemaStore {
     type Error = ArrowError;
 
-    /// Creates a `SchemaStore` from a slice of schemas.
-    /// Each schema in the slice is registered with the new store.
-    fn try_from(schemas: &[AvroSchema]) -> Result<Self, Self::Error> {
+    /// Creates a `SchemaStore` from a HashMap of schemas.
+    /// Each schema in the HashMap is registered with the new store.
+    fn try_from(schemas: &HashMap<Fingerprint, AvroSchema>) -> Result<Self, 
Self::Error> {

Review Comment:
   You could probably simply this method now and implement it like this:
   
   ```rust
       fn try_from(schemas: &HashMap<Fingerprint, AvroSchema>) -> Result<Self, 
Self::Error> {
           Ok(Self {
               schemas: schemas.clone(),
               ..Self::default()
           })
       }
   ```
   
   Also since we're going this direction, we'll need to make the `pub(crate) fn 
generate_fingerprint` method on lines 429-450 fully public and well documented 
with an example. 
   
   End users will need to use `generate_fingerprint` to generate fingerprints 
to use the updated `SchemaStore::try_from()` method.



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to