Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions arrow/src/array/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub trait Array: fmt::Debug + Send + Sync + JsonEqual {
/// # Ok(())
/// # }
/// ```
fn as_any(&self) -> &Any;
fn as_any(&self) -> &dyn Any;

/// Returns a reference to the underlying data of this array.
fn data(&self) -> &ArrayData;
Expand Down Expand Up @@ -224,7 +224,7 @@ pub trait Array: fmt::Debug + Send + Sync + JsonEqual {
}

/// A reference-counted reference to a generic `Array`.
pub type ArrayRef = Arc<Array>;
pub type ArrayRef = Arc<dyn Array>;

/// Constructs an array using the input `data`.
/// Returns a reference-counted `Array` instance.
Expand Down
6 changes: 3 additions & 3 deletions arrow/src/array/array_binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ impl<OffsetSize: BinaryOffsetSizeTrait> fmt::Debug for GenericBinaryArray<Offset
}

impl<OffsetSize: BinaryOffsetSizeTrait> Array for GenericBinaryArray<OffsetSize> {
fn as_any(&self) -> &Any {
fn as_any(&self) -> &dyn Any {
self
}

Expand Down Expand Up @@ -582,7 +582,7 @@ impl fmt::Debug for FixedSizeBinaryArray {
}

impl Array for FixedSizeBinaryArray {
fn as_any(&self) -> &Any {
fn as_any(&self) -> &dyn Any {
self
}

Expand Down Expand Up @@ -752,7 +752,7 @@ impl fmt::Debug for DecimalArray {
}

impl Array for DecimalArray {
fn as_any(&self) -> &Any {
fn as_any(&self) -> &dyn Any {
self
}

Expand Down
2 changes: 1 addition & 1 deletion arrow/src/array/array_boolean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ impl BooleanArray {
}

impl Array for BooleanArray {
fn as_any(&self) -> &Any {
fn as_any(&self) -> &dyn Any {
self
}

Expand Down
2 changes: 1 addition & 1 deletion arrow/src/array/array_dictionary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ impl<'a, T: ArrowPrimitiveType + ArrowDictionaryKeyType> FromIterator<&'a str>
}

impl<T: ArrowPrimitiveType> Array for DictionaryArray<T> {
fn as_any(&self) -> &Any {
fn as_any(&self) -> &dyn Any {
self
}

Expand Down
4 changes: 2 additions & 2 deletions arrow/src/array/array_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ impl<OffsetSize: OffsetSizeTrait> GenericListArray<OffsetSize> {
}

impl<OffsetSize: 'static + OffsetSizeTrait> Array for GenericListArray<OffsetSize> {
fn as_any(&self) -> &Any {
fn as_any(&self) -> &dyn Any {
self
}

Expand Down Expand Up @@ -426,7 +426,7 @@ impl From<ArrayData> for FixedSizeListArray {
}

impl Array for FixedSizeListArray {
fn as_any(&self) -> &Any {
fn as_any(&self) -> &dyn Any {
self
}

Expand Down
2 changes: 1 addition & 1 deletion arrow/src/array/array_primitive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ impl<T: ArrowPrimitiveType> PrimitiveArray<T> {
}

impl<T: ArrowPrimitiveType> Array for PrimitiveArray<T> {
fn as_any(&self) -> &Any {
fn as_any(&self) -> &dyn Any {
self
}

Expand Down
2 changes: 1 addition & 1 deletion arrow/src/array/array_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ impl<OffsetSize: StringOffsetSizeTrait> fmt::Debug for GenericStringArray<Offset
}

impl<OffsetSize: StringOffsetSizeTrait> Array for GenericStringArray<OffsetSize> {
fn as_any(&self) -> &Any {
fn as_any(&self) -> &dyn Any {
self
}

Expand Down
2 changes: 1 addition & 1 deletion arrow/src/array/array_struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ impl TryFrom<Vec<(&str, ArrayRef)>> for StructArray {
}

impl Array for StructArray {
fn as_any(&self) -> &Any {
fn as_any(&self) -> &dyn Any {
self
}

Expand Down
2 changes: 1 addition & 1 deletion arrow/src/array/array_union.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ impl From<ArrayData> for UnionArray {
}

impl Array for UnionArray {
fn as_any(&self) -> &Any {
fn as_any(&self) -> &dyn Any {
self
}

Expand Down
78 changes: 39 additions & 39 deletions arrow/src/array/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -458,17 +458,17 @@ pub trait ArrayBuilder: Any + Send {
/// This is most useful when one wants to call non-mutable APIs on a specific builder
/// type. In this case, one can first cast this into a `Any`, and then use
/// `downcast_ref` to get a reference on the specific builder.
fn as_any(&self) -> &Any;
fn as_any(&self) -> &dyn Any;

/// Returns the builder as a mutable `Any` reference.
///
/// This is most useful when one wants to call mutable APIs on a specific builder
/// type. In this case, one can first cast this into a `Any`, and then use
/// `downcast_mut` to get a reference on the specific builder.
fn as_any_mut(&mut self) -> &mut Any;
fn as_any_mut(&mut self) -> &mut dyn Any;

/// Returns the boxed builder as a box of `Any`.
fn into_box_any(self: Box<Self>) -> Box<Any>;
fn into_box_any(self: Box<Self>) -> Box<dyn Any>;
}

/// Array builder for fixed-width primitive types
Expand Down Expand Up @@ -557,17 +557,17 @@ impl BooleanBuilder {

impl ArrayBuilder for BooleanBuilder {
/// Returns the builder as a non-mutable `Any` reference.
fn as_any(&self) -> &Any {
fn as_any(&self) -> &dyn Any {
self
}

/// Returns the builder as a mutable `Any` reference.
fn as_any_mut(&mut self) -> &mut Any {
fn as_any_mut(&mut self) -> &mut dyn Any {
self
}

/// Returns the boxed builder as a box of `Any`.
fn into_box_any(self: Box<Self>) -> Box<Any> {
fn into_box_any(self: Box<Self>) -> Box<dyn Any> {
self
}

Expand Down Expand Up @@ -598,17 +598,17 @@ pub struct PrimitiveBuilder<T: ArrowPrimitiveType> {

impl<T: ArrowPrimitiveType> ArrayBuilder for PrimitiveBuilder<T> {
/// Returns the builder as a non-mutable `Any` reference.
fn as_any(&self) -> &Any {
fn as_any(&self) -> &dyn Any {
self
}

/// Returns the builder as a mutable `Any` reference.
fn as_any_mut(&mut self) -> &mut Any {
fn as_any_mut(&mut self) -> &mut dyn Any {
self
}

/// Returns the boxed builder as a box of `Any`.
fn into_box_any(self: Box<Self>) -> Box<Any> {
fn into_box_any(self: Box<Self>) -> Box<dyn Any> {
self
}

Expand Down Expand Up @@ -793,17 +793,17 @@ where
T: 'static,
{
/// Returns the builder as a non-mutable `Any` reference.
fn as_any(&self) -> &Any {
fn as_any(&self) -> &dyn Any {
self
}

/// Returns the builder as a mutable `Any` reference.
fn as_any_mut(&mut self) -> &mut Any {
fn as_any_mut(&mut self) -> &mut dyn Any {
self
}

/// Returns the boxed builder as a box of `Any`.
fn into_box_any(self: Box<Self>) -> Box<Any> {
fn into_box_any(self: Box<Self>) -> Box<dyn Any> {
self
}

Expand Down Expand Up @@ -921,17 +921,17 @@ where
T: 'static,
{
/// Returns the builder as a non-mutable `Any` reference.
fn as_any(&self) -> &Any {
fn as_any(&self) -> &dyn Any {
self
}

/// Returns the builder as a mutable `Any` reference.
fn as_any_mut(&mut self) -> &mut Any {
fn as_any_mut(&mut self) -> &mut dyn Any {
self
}

/// Returns the boxed builder as a box of `Any`.
fn into_box_any(self: Box<Self>) -> Box<Any> {
fn into_box_any(self: Box<Self>) -> Box<dyn Any> {
self
}

Expand Down Expand Up @@ -1044,17 +1044,17 @@ impl<OffsetSize: BinaryOffsetSizeTrait> ArrayBuilder
for GenericBinaryBuilder<OffsetSize>
{
/// Returns the builder as a non-mutable `Any` reference.
fn as_any(&self) -> &Any {
fn as_any(&self) -> &dyn Any {
self
}

/// Returns the builder as a mutable `Any` reference.
fn as_any_mut(&mut self) -> &mut Any {
fn as_any_mut(&mut self) -> &mut dyn Any {
self
}

/// Returns the boxed builder as a box of `Any`.
fn into_box_any(self: Box<Self>) -> Box<Any> {
fn into_box_any(self: Box<Self>) -> Box<dyn Any> {
self
}

Expand All @@ -1078,17 +1078,17 @@ impl<OffsetSize: StringOffsetSizeTrait> ArrayBuilder
for GenericStringBuilder<OffsetSize>
{
/// Returns the builder as a non-mutable `Any` reference.
fn as_any(&self) -> &Any {
fn as_any(&self) -> &dyn Any {
self
}

/// Returns the builder as a mutable `Any` reference.
fn as_any_mut(&mut self) -> &mut Any {
fn as_any_mut(&mut self) -> &mut dyn Any {
self
}

/// Returns the boxed builder as a box of `Any`.
fn into_box_any(self: Box<Self>) -> Box<Any> {
fn into_box_any(self: Box<Self>) -> Box<dyn Any> {
self
}

Expand All @@ -1111,17 +1111,17 @@ impl<OffsetSize: StringOffsetSizeTrait> ArrayBuilder

impl ArrayBuilder for FixedSizeBinaryBuilder {
/// Returns the builder as a non-mutable `Any` reference.
fn as_any(&self) -> &Any {
fn as_any(&self) -> &dyn Any {
self
}

/// Returns the builder as a mutable `Any` reference.
fn as_any_mut(&mut self) -> &mut Any {
fn as_any_mut(&mut self) -> &mut dyn Any {
self
}

/// Returns the boxed builder as a box of `Any`.
fn into_box_any(self: Box<Self>) -> Box<Any> {
fn into_box_any(self: Box<Self>) -> Box<dyn Any> {
self
}

Expand All @@ -1143,17 +1143,17 @@ impl ArrayBuilder for FixedSizeBinaryBuilder {

impl ArrayBuilder for DecimalBuilder {
/// Returns the builder as a non-mutable `Any` reference.
fn as_any(&self) -> &Any {
fn as_any(&self) -> &dyn Any {
self
}

/// Returns the builder as a mutable `Any` reference.
fn as_any_mut(&mut self) -> &mut Any {
fn as_any_mut(&mut self) -> &mut dyn Any {
self
}

/// Returns the boxed builder as a box of `Any`.
fn into_box_any(self: Box<Self>) -> Box<Any> {
fn into_box_any(self: Box<Self>) -> Box<dyn Any> {
self
}

Expand Down Expand Up @@ -1381,7 +1381,7 @@ impl DecimalBuilder {
/// properly called to maintain the consistency of the data structure.
pub struct StructBuilder {
fields: Vec<Field>,
field_builders: Vec<Box<ArrayBuilder>>,
field_builders: Vec<Box<dyn ArrayBuilder>>,
bitmap_builder: BooleanBufferBuilder,
len: usize,
}
Expand Down Expand Up @@ -1421,7 +1421,7 @@ impl ArrayBuilder for StructBuilder {
/// This is most useful when one wants to call non-mutable APIs on a specific builder
/// type. In this case, one can first cast this into a `Any`, and then use
/// `downcast_ref` to get a reference on the specific builder.
fn as_any(&self) -> &Any {
fn as_any(&self) -> &dyn Any {
self
}

Expand All @@ -1430,20 +1430,20 @@ impl ArrayBuilder for StructBuilder {
/// This is most useful when one wants to call mutable APIs on a specific builder
/// type. In this case, one can first cast this into a `Any`, and then use
/// `downcast_mut` to get a reference on the specific builder.
fn as_any_mut(&mut self) -> &mut Any {
fn as_any_mut(&mut self) -> &mut dyn Any {
self
}

/// Returns the boxed builder as a box of `Any`.
fn into_box_any(self: Box<Self>) -> Box<Any> {
fn into_box_any(self: Box<Self>) -> Box<dyn Any> {
self
}
}

/// Returns a builder with capacity `capacity` that corresponds to the datatype `DataType`
/// This function is useful to construct arrays from an arbitrary vectors with known/expected
/// schema.
pub fn make_builder(datatype: &DataType, capacity: usize) -> Box<ArrayBuilder> {
pub fn make_builder(datatype: &DataType, capacity: usize) -> Box<dyn ArrayBuilder> {
match datatype {
DataType::Null => unimplemented!(),
DataType::Boolean => Box::new(BooleanBuilder::new(capacity)),
Expand Down Expand Up @@ -1517,7 +1517,7 @@ pub fn make_builder(datatype: &DataType, capacity: usize) -> Box<ArrayBuilder> {
}

impl StructBuilder {
pub fn new(fields: Vec<Field>, field_builders: Vec<Box<ArrayBuilder>>) -> Self {
pub fn new(fields: Vec<Field>, field_builders: Vec<Box<dyn ArrayBuilder>>) -> Self {
Self {
fields,
field_builders,
Expand Down Expand Up @@ -1893,17 +1893,17 @@ where
V: ArrowPrimitiveType,
{
/// Returns the builder as an non-mutable `Any` reference.
fn as_any(&self) -> &Any {
fn as_any(&self) -> &dyn Any {
self
}

/// Returns the builder as an mutable `Any` reference.
fn as_any_mut(&mut self) -> &mut Any {
fn as_any_mut(&mut self) -> &mut dyn Any {
self
}

/// Returns the boxed builder as a box of `Any`.
fn into_box_any(self: Box<Self>) -> Box<Any> {
fn into_box_any(self: Box<Self>) -> Box<dyn Any> {
self
}

Expand Down Expand Up @@ -2083,17 +2083,17 @@ where
K: ArrowDictionaryKeyType,
{
/// Returns the builder as an non-mutable `Any` reference.
fn as_any(&self) -> &Any {
fn as_any(&self) -> &dyn Any {
self
}

/// Returns the builder as an mutable `Any` reference.
fn as_any_mut(&mut self) -> &mut Any {
fn as_any_mut(&mut self) -> &mut dyn Any {
self
}

/// Returns the boxed builder as a box of `Any`.
fn into_box_any(self: Box<Self>) -> Box<Any> {
fn into_box_any(self: Box<Self>) -> Box<dyn Any> {
self
}

Expand Down
Loading