findepi commented on issue #5819:
URL: https://github.com/apache/arrow-rs/issues/5819#issuecomment-3323728206
I tried to workaround lack of `AsRef` provided by `Field`.
Of course, rust won't allow me to just add `impl AsRef<Field> for Field` in
downstream project, so I tried to get away with my own trait as a replacement
for `AsRef`
```rust
// workaround for the fact that Field does not implement AsRef<Field>
trait AsFieldRef {
fn as_ref(&self) -> &Field;
}
impl AsFieldRef for Field {
fn as_ref(&self) -> &Field {
self
}
}
impl<T> AsFieldRef for T
where
T: AsRef<Field>,
{
fn as_ref(&self) -> &Field {
self.as_ref()
}
}
```
Unfortunately, this won't work either. Rust reports duplicate implementation
because upstream may add `impl AsRef<Field> for Field` in the future.
--
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]