alamb commented on code in PR #8417:
URL: https://github.com/apache/arrow-rs/pull/8417#discussion_r2376848056
##########
arrow-schema/src/field.rs:
##########
@@ -132,6 +132,12 @@ impl Hash for Field {
}
}
+impl AsRef<Field> for Field {
Review Comment:
I think I am confused then (unsurprising!)
The tests have these three examples
If you change the signature to the standard
```rurst
fn accept_ref(_: &Field) {}
```
the only one that doesn't work is the first one
```rust
accept_ref(Arc::new(field())); // <-- the compiler flags this as an
error
accept_ref(&Arc::new(field()));
accept_ref(&&Arc::new(field()));
```
Which to me is what I wanted (to have to use `&` to signify the function
doesn't need an owned Field` 🤔
--
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]