findepi commented on code in PR #8417:
URL: https://github.com/apache/arrow-rs/pull/8417#discussion_r2376811940
##########
arrow-schema/src/field.rs:
##########
@@ -132,6 +132,12 @@ impl Hash for Field {
}
}
+impl AsRef<Field> for Field {
Review Comment:
My goes is indeed not to call `my_function(field)` when it doesn't need a
field.
However, lack of `AsRef<Field>` prevents `my_function(&field)` from working
as well
that's probably because `AsRef` has a blanket impl for `&T`
generally for `AsRef` to work with MyType, one has to implement `AsRef for
MyType`. that's apparently how Rust folks designed this mechanism. And that's
what AsRef doc says too.
--
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]