chmp opened a new issue, #5819:
URL: https://github.com/apache/arrow-rs/issues/5819

   I am maintaining the [`serde_arrow`](https://github.com/chmp/serde_arrow) 
crate. Initially I used `&[Field]` in my signatures, but more recently switched 
to the more idiomatic `&[FieldRef]`. I could cover both signatures with a 
generic `F: AsRef<Field>`, if `arrow` were to implement 
`std::convert::AsRef<Field>` for `Field`.
   
   I recognize that this is a convenience feature for a single crate, but as it 
is easy to implement, I wanted to give it a shot :)
   
   Required impl:
   
   ```rust
   impl std::convert::AsRef<Field> for Field{
       fn as_ref(&self) -> &Field{
           self
       }
   }
   ```
   
   Context: the Rust docs contain a 
[section](https://doc.rust-lang.org/stable/std/convert/trait.AsRef.html#reflexivity)
 on implementing `AsRef` for you own types.


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