Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
remove as_fixed_size_array which is only useful for decimal
Browse files Browse the repository at this point in the history
  • Loading branch information
Igosuki committed Jan 3, 2022
1 parent 55d01ec commit b67e9b4
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/array/fixed_size_binary/mutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,6 @@ impl MutableFixedSizeBinaryArray {
validity.shrink_to_fit()
}
}

/// Creates an owned [`FixedSizeBinaryArray`] from current data
pub fn as_fixed_size_array(&mut self) -> FixedSizeBinaryArray {
FixedSizeBinaryArray::from_data(
DataType::FixedSizeBinary(self.size),
std::mem::take(&mut self.values).into(),
std::mem::take(&mut self.validity).map(|x| x.into()),
)
}
}

/// Accessors
Expand All @@ -196,11 +187,19 @@ impl MutableArray for MutableFixedSizeBinaryArray {
}

fn as_box(&mut self) -> Box<dyn Array> {
Box::new(self.as_fixed_size_array())
Box::new(FixedSizeBinaryArray::from_data(
DataType::FixedSizeBinary(self.size),
std::mem::take(&mut self.values).into(),
std::mem::take(&mut self.validity).map(|x| x.into()),
))
}

fn as_arc(&mut self) -> Arc<dyn Array> {
Arc::new(self.as_fixed_size_array())
Arc::new(FixedSizeBinaryArray::from_data(
DataType::FixedSizeBinary(self.size),
std::mem::take(&mut self.values).into(),
std::mem::take(&mut self.validity).map(|x| x.into()),
))
}

fn data_type(&self) -> &DataType {
Expand Down

0 comments on commit b67e9b4

Please sign in to comment.