scovich commented on code in PR #12455:
URL: https://github.com/apache/arrow-rs/pull/12455#discussion_r4688552022
##########
arrow-array/src/array/mod.rs:
##########
@@ -550,11 +572,106 @@ unsafe impl Array for ArrayRef {
}
}
+// Ergonomics: allow passing e.g. `&Arc<Int32Array>` to methods that expect
`&dyn Array`
+unsafe impl<T: Array + 'static> Array for Arc<T> {
+ fn as_any(&self) -> &dyn Any {
+ T::as_any(self)
+ }
+
+ fn into_any_arc(self: Arc<Self>) -> Arc<dyn Any + Send + Sync> {
+ T::into_any_arc(Arc::clone(&*self))
+ }
+
+ fn to_arc(&self) -> ArrayRef {
+ Arc::clone(self) as ArrayRef
Review Comment:
Never mind, type inference fails without the cast.
--
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]