Repository: jorgecarleitao/arrow2
Pull request #330 (2021-08-24 10:13:28)

Cleaned examples and docs from old API.

codecov[bot]: # [Codecov](https://codecov.io/gh/jorgecarleitao/arrow2/pull/330?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jorge+Leitao) Report
> Merging [#330](https://codecov.io/gh/jorgecarleitao/arrow2/pull/330?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jorge+Leitao) (21fad38) into [main](https://codecov.io/gh/jorgecarleitao/arrow2/commit/824ad7ec8d714449f321683d963c9b737ff736ba?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jorge+Leitao) (824ad7e) will **decrease** coverage by `0.02%`.
> The diff coverage is `100.00%`.

[![Impacted file tree graph](https://codecov.io/gh/jorgecarleitao/arrow2/pull/330/graphs/tree.svg?width=650&height=150&src=pr&token=AgyTF60R3D&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jorge+Leitao)](https://codecov.io/gh/jorgecarleitao/arrow2/pull/330?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jorge+Leitao)

```diff
@@            Coverage Diff             @@
##             main     #330      +/-   ##
==========================================
- Coverage   80.55%   80.53%   -0.03%     
==========================================
  Files         324      325       +1     
  Lines       21399    21604     +205     
==========================================
+ Hits        17239    17398     +159     
- Misses       4160     4206      +46     
```


| [Impacted Files](https://codecov.io/gh/jorgecarleitao/arrow2/pull/330?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jorge+Leitao) | Coverage Δ | |
|---|---|---|
| [arrow-pyarrow-integration-testing/src/lib.rs](https://codecov.io/gh/jorgecarleitao/arrow2/pull/330/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jorge+Leitao#diff-YXJyb3ctcHlhcnJvdy1pbnRlZ3JhdGlvbi10ZXN0aW5nL3NyYy9saWIucnM=) | `0.00% <ø> (ø)` | |
| [src/array/ord.rs](https://codecov.io/gh/jorgecarleitao/arrow2/pull/330/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jorge+Leitao#diff-c3JjL2FycmF5L29yZC5ycw==) | `65.26% <ø> (ø)` | |
| [src/compute/arithmetics/basic/add.rs](https://codecov.io/gh/jorgecarleitao/arrow2/pull/330/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jorge+Leitao#diff-c3JjL2NvbXB1dGUvYXJpdGhtZXRpY3MvYmFzaWMvYWRkLnJz) | `94.83% <ø> (ø)` | |
| [src/compute/arithmetics/mod.rs](https://codecov.io/gh/jorgecarleitao/arrow2/pull/330/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jorge+Leitao#diff-c3JjL2NvbXB1dGUvYXJpdGhtZXRpY3MvbW9kLnJz) | `51.12% <ø> (ø)` | |
| [src/compute/filter.rs](https://codecov.io/gh/jorgecarleitao/arrow2/pull/330/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jorge+Leitao#diff-c3JjL2NvbXB1dGUvZmlsdGVyLnJz) | `63.19% <ø> (ø)` | |
| [src/io/json/write/serialize.rs](https://codecov.io/gh/jorgecarleitao/arrow2/pull/330/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jorge+Leitao#diff-c3JjL2lvL2pzb24vd3JpdGUvc2VyaWFsaXplLnJz) | `62.26% <ø> (ø)` | |
| [src/record\_batch.rs](https://codecov.io/gh/jorgecarleitao/arrow2/pull/330/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jorge+Leitao#diff-c3JjL3JlY29yZF9iYXRjaC5ycw==) | `44.44% <ø> (ø)` | |
| [src/compute/arithmetics/decimal/add.rs](https://codecov.io/gh/jorgecarleitao/arrow2/pull/330/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jorge+Leitao#diff-c3JjL2NvbXB1dGUvYXJpdGhtZXRpY3MvZGVjaW1hbC9hZGQucnM=) | `91.27% <100.00%> (-1.51%)` | :arrow_down: |
| [src/compute/arithmetics/decimal/div.rs](https://codecov.io/gh/jorgecarleitao/arrow2/pull/330/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jorge+Leitao#diff-c3JjL2NvbXB1dGUvYXJpdGhtZXRpY3MvZGVjaW1hbC9kaXYucnM=) | `92.07% <100.00%> (ø)` | |
| [src/compute/arithmetics/decimal/mul.rs](https://codecov.io/gh/jorgecarleitao/arrow2/pull/330/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jorge+Leitao#diff-c3JjL2NvbXB1dGUvYXJpdGhtZXRpY3MvZGVjaW1hbC9tdWwucnM=) | `92.03% <100.00%> (-0.07%)` | :arrow_down: |
| ... and [19 more](https://codecov.io/gh/jorgecarleitao/arrow2/pull/330/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jorge+Leitao) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/jorgecarleitao/arrow2/pull/330?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jorge+Leitao).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jorge+Leitao)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/jorgecarleitao/arrow2/pull/330?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jorge+Leitao). Last update [824ad7e...21fad38](https://codecov.io/gh/jorgecarleitao/arrow2/pull/330?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jorge+Leitao). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jorge+Leitao).


Patch:
diff --git a/benches/take_kernels.rs b/benches/take_kernels.rs
index a66ae30503..062d1258df 100644
--- a/benches/take_kernels.rs
+++ b/benches/take_kernels.rs
@@ -42,7 +42,6 @@ fn create_random_index(size: usize, null_density: f32) -> PrimitiveArray<i32> {
             }
         })
         .collect::<PrimitiveArray<i32>>()
-        .to(DataType::Int32)
 }
 
 fn bench_take(values: &dyn Array, indices: &PrimitiveArray<i32>) {
diff --git a/guide/src/ffi.md b/guide/src/ffi.md
index 0d6d2f2b60..2cf87b0b9c 100644
--- a/guide/src/ffi.md
+++ b/guide/src/ffi.md
@@ -28,8 +28,7 @@ use arrow2::ffi::ArrowArray;
 // Example of an array:
 let array = [Some(1), None, Some(123)]
     .iter()
-    .collect::<PrimitiveArray<i32>>()
-    .to(DataType::Int32);
+    .collect::<PrimitiveArray<i32>>();
 
 // export the array.
 let ffi_array = ffi::export_to_c(Arc::new(array))?;
diff --git a/guide/src/high_level.md b/guide/src/high_level.md
index b757fd2d74..8d6e93aded 100644
--- a/guide/src/high_level.md
+++ b/guide/src/high_level.md
@@ -34,8 +34,8 @@ The first difference allows interoperability with Arrow's ecosystem and efficien
 # use arrow2::array::PrimitiveArray;
 # use arrow2::datatypes::DataType;
 # fn main() {
-let ints = PrimitiveArray::<i32>::from(&[Some(1), None]).to(DataType::Int32);
-let dates = PrimitiveArray::<i32>::from(&[Some(1), None]).to(DataType::Date32);
+let ints = PrimitiveArray::<i32>::from([Some(1), None]);
+let dates = PrimitiveArray::<i32>::from([Some(1), None]);
 # }
 ```
 
diff --git a/src/array/ord.rs b/src/array/ord.rs
index 1ca236de78..ea9d0d69a3 100644
--- a/src/array/ord.rs
+++ b/src/array/ord.rs
@@ -124,11 +124,10 @@ macro_rules! dyn_dict {
 /// # Example
 /// ```
 /// use arrow2::array::{ord::build_compare, PrimitiveArray};
-/// use arrow2::datatypes::DataType;
 ///
 /// # fn main() -> arrow2::error::Result<()> {
-/// let array1 = PrimitiveArray::from_slice(&[1, 2]).to(DataType::Int32);
-/// let array2 = PrimitiveArray::from_slice(&[3, 4]).to(DataType::Int32);
+/// let array1 = PrimitiveArray::from_slice([1, 2]);
+/// let array2 = PrimitiveArray::from_slice([3, 4]);
 ///
 /// let cmp = build_compare(&array1, &array2)?;
 ///
diff --git a/src/compute/arithmetics/basic/add.rs b/src/compute/arithmetics/basic/add.rs
index 235e7686e7..f6b89fd889 100644
--- a/src/compute/arithmetics/basic/add.rs
+++ b/src/compute/arithmetics/basic/add.rs
@@ -28,12 +28,11 @@ use crate::{
 /// ```
 /// use arrow2::compute::arithmetics::basic::add::add;
 /// use arrow2::array::PrimitiveArray;
-/// use arrow2::datatypes::DataType;
 ///
-/// let a = PrimitiveArray::from(&vec![None, Some(6), None, Some(6)]).to(DataType::Int32);
-/// let b = PrimitiveArray::from(&vec![Some(5), None, None, Some(6)]).to(DataType::Int32);
+/// let a = PrimitiveArray::from([None, Some(6), None, Some(6)]);
+/// let b = PrimitiveArray::from([Some(5), None, None, Some(6)]);
 /// let result = add(&a, &b).unwrap();
-/// let expected = PrimitiveArray::from(&vec![None, None, None, Some(12)]).to(DataType::Int32);
+/// let expected = PrimitiveArray::from([None, None, None, Some(12)]);
 /// assert_eq!(result, expected)
 /// ```
 pub fn add<T>(lhs: &PrimitiveArray<T>, rhs: &PrimitiveArray<T>) -> Result<PrimitiveArray<T>>
@@ -56,12 +55,11 @@ where
 /// ```
 /// use arrow2::compute::arithmetics::basic::add::checked_add;
 /// use arrow2::array::PrimitiveArray;
-/// use arrow2::datatypes::DataType;
 ///
-/// let a = PrimitiveArray::from(&vec![Some(100i8), Some(100i8), Some(100i8)]).to(DataType::Int8);
-/// let b = PrimitiveArray::from(&vec![Some(0i8), Some(100i8), Some(0i8)]).to(DataType::Int8);
+/// let a = PrimitiveArray::from([Some(100i8), Some(100i8), Some(100i8)]);
+/// let b = PrimitiveArray::from([Some(0i8), Some(100i8), Some(0i8)]);
 /// let result = checked_add(&a, &b).unwrap();
-/// let expected = PrimitiveArray::from(&vec![Some(100i8), None, Some(100i8)]).to(DataType::Int8);
+/// let expected = PrimitiveArray::from([Some(100i8), None, Some(100i8)]);
 /// assert_eq!(result, expected);
 /// ```
 pub fn checked_add<T>(lhs: &PrimitiveArray<T>, rhs: &PrimitiveArray<T>) -> Result<PrimitiveArray<T>>
@@ -87,12 +85,11 @@ where
 /// ```
 /// use arrow2::compute::arithmetics::basic::add::saturating_add;
 /// use arrow2::array::PrimitiveArray;
-/// use arrow2::datatypes::DataType;
 ///
-/// let a = PrimitiveArray::from(&vec![Some(100i8)]).to(DataType::Int8);
-/// let b = PrimitiveArray::from(&vec![Some(100i8)]).to(DataType::Int8);
+/// let a = PrimitiveArray::from([Some(100i8)]);
+/// let b = PrimitiveArray::from([Some(100i8)]);
 /// let result = saturating_add(&a, &b).unwrap();
-/// let expected = PrimitiveArray::from(&vec![Some(127)]).to(DataType::Int8);
+/// let expected = PrimitiveArray::from([Some(127)]);
 /// assert_eq!(result, expected);
 /// ```
 pub fn saturating_add<T>(
@@ -122,12 +119,11 @@ where
 /// ```
 /// use arrow2::compute::arithmetics::basic::add::overflowing_add;
 /// use arrow2::array::PrimitiveArray;
-/// use arrow2::datatypes::DataType;
 ///
-/// let a = PrimitiveArray::from(&vec![Some(1i8), Some(100i8)]).to(DataType::Int8);
-/// let b = PrimitiveArray::from(&vec![Some(1i8), Some(100i8)]).to(DataType::Int8);
+/// let a = PrimitiveArray::from([Some(1i8), Some(100i8)]);
+/// let b = PrimitiveArray::from([Some(1i8), Some(100i8)]);
 /// let (result, overflow) = overflowing_add(&a, &b).unwrap();
-/// let expected = PrimitiveArray::from(&vec![Some(2i8), Some(-56i8)]).to(DataType::Int8);
+/// let expected = PrimitiveArray::from([Some(2i8), Some(-56i8)]);
 /// assert_eq!(result, expected);
 /// ```
 pub fn overflowing_add<T>(
@@ -203,11 +199,10 @@ where
 /// ```
 /// use arrow2::compute::arithmetics::basic::add::add_scalar;
 /// use arrow2::array::PrimitiveArray;
-/// use arrow2::datatypes::DataType;
 ///
-/// let a = PrimitiveArray::from(&vec![None, Some(6), None, Some(6)]).to(DataType::Int32);
+/// let a = PrimitiveArray::from([None, Some(6), None, Some(6)]);
 /// let result = add_scalar(&a, &1i32);
-/// let expected = PrimitiveArray::from(&vec![None, Some(7), None, Some(7)]).to(DataType::Int32);
+/// let expected = PrimitiveArray::from([None, Some(7), None, Some(7)]);
 /// assert_eq!(result, expected)
 /// ```
 pub fn add_scalar<T>(lhs: &PrimitiveArray<T>, rhs: &T) -> PrimitiveArray<T>
@@ -250,11 +245,10 @@ where
 /// ```
 /// use arrow2::compute::arithmetics::basic::add::saturating_add_scalar;
 /// use arrow2::array::PrimitiveArray;
-/// use arrow2::datatypes::DataType;
 ///
-/// let a = PrimitiveArray::from(&vec![Some(100i8)]).to(DataType::Int8);
+/// let a = PrimitiveArray::from([Some(100i8)]);
 /// let result = saturating_add_scalar(&a, &100i8);
-/// let expected = PrimitiveArray::from(&vec![Some(127)]).to(DataType::Int8);
+/// let expected = PrimitiveArray::from([Some(127)]);
 /// assert_eq!(result, expected);
 /// ```
 pub fn saturating_add_scalar<T>(lhs: &PrimitiveArray<T>, rhs: &T) -> PrimitiveArray<T>
@@ -276,11 +270,10 @@ where
 /// ```
 /// use arrow2::compute::arithmetics::basic::add::overflowing_add_scalar;
 /// use arrow2::array::PrimitiveArray;
-/// use arrow2::datatypes::DataType;
 ///
-/// let a = PrimitiveArray::from(&vec![Some(1i8), Some(100i8)]).to(DataType::Int8);
+/// let a = PrimitiveArray::from([Some(1i8), Some(100i8)]);
 /// let (result, overflow) = overflowing_add_scalar(&a, &100i8);
-/// let expected = PrimitiveArray::from(&vec![Some(101i8), Some(-56i8)]).to(DataType::Int8);
+/// let expected = PrimitiveArray::from([Some(101i8), Some(-56i8)]);
 /// assert_eq!(result, expected);
 /// ```
 pub fn overflowing_add_scalar<T>(lhs: &PrimitiveArray<T>, rhs: &T) -> (PrimitiveArray<T>, Bitmap)
diff --git a/src/compute/arithmetics/decimal/add.rs b/src/compute/arithmetics/decimal/add.rs
index 92c6cb7287..792b89e74e 100644
--- a/src/compute/arithmetics/decimal/add.rs
+++ b/src/compute/arithmetics/decimal/add.rs
@@ -43,11 +43,11 @@ use super::{adjusted_precision_scale, max_value, number_digits};
 /// use arrow2::array::PrimitiveArray;
 /// use arrow2::datatypes::DataType;
 ///
-/// let a = PrimitiveArray::from(&vec![Some(1i128), Some(1i128), None, Some(2i128)]).to(DataType::Decimal(5, 2));
-/// let b = PrimitiveArray::from(&vec![Some(1i128), Some(2i128), None, Some(2i128)]).to(DataType::Decimal(5, 2));
+/// let a = PrimitiveArray::from([Some(1i128), Some(1i128), None, Some(2i128)]).to(DataType::Decimal(5, 2));
+/// let b = PrimitiveArray::from([Some(1i128), Some(2i128), None, Some(2i128)]).to(DataType::Decimal(5, 2));
 ///
 /// let result = add(&a, &b).unwrap();
-/// let expected = PrimitiveArray::from(&vec![Some(2i128), Some(3i128), None, Some(4i128)]).to(DataType::Decimal(5, 2));
+/// let expected = PrimitiveArray::from([Some(2i128), Some(3i128), None, Some(4i128)]).to(DataType::Decimal(5, 2));
 ///
 /// assert_eq!(result, expected);
 /// ```
@@ -96,11 +96,11 @@ pub fn add(lhs: &PrimitiveArray<i128>, rhs: &PrimitiveArray<i128>) -> Result<Pri
 /// use arrow2::array::PrimitiveArray;
 /// use arrow2::datatypes::DataType;
 ///
-/// let a = PrimitiveArray::from(&vec![Some(99000i128), Some(11100i128), None, Some(22200i128)]).to(DataType::Decimal(5, 2));
-/// let b = PrimitiveArray::from(&vec![Some(01000i128), Some(22200i128), None, Some(11100i128)]).to(DataType::Decimal(5, 2));
+/// let a = PrimitiveArray::from([Some(99000i128), Some(11100i128), None, Some(22200i128)]).to(DataType::Decimal(5, 2));
+/// let b = PrimitiveArray::from([Some(01000i128), Some(22200i128), None, Some(11100i128)]).to(DataType::Decimal(5, 2));
 ///
 /// let result = saturating_add(&a, &b).unwrap();
-/// let expected = PrimitiveArray::from(&vec![Some(99999i128), Some(33300i128), None, Some(33300i128)]).to(DataType::Decimal(5, 2));
+/// let expected = PrimitiveArray::from([Some(99999i128), Some(33300i128), None, Some(33300i128)]).to(DataType::Decimal(5, 2));
 ///
 /// assert_eq!(result, expected);
 /// ```
@@ -156,11 +156,11 @@ pub fn saturating_add(
 /// use arrow2::array::PrimitiveArray;
 /// use arrow2::datatypes::DataType;
 ///
-/// let a = PrimitiveArray::from(&vec![Some(99000i128), Some(11100i128), None, Some(22200i128)]).to(DataType::Decimal(5, 2));
-/// let b = PrimitiveArray::from(&vec![Some(01000i128), Some(22200i128), None, Some(11100i128)]).to(DataType::Decimal(5, 2));
+/// let a = PrimitiveArray::from([Some(99000i128), Some(11100i128), None, Some(22200i128)]).to(DataType::Decimal(5, 2));
+/// let b = PrimitiveArray::from([Some(01000i128), Some(22200i128), None, Some(11100i128)]).to(DataType::Decimal(5, 2));
 ///
 /// let result = checked_add(&a, &b).unwrap();
-/// let expected = PrimitiveArray::from(&vec![None, Some(33300i128), None, Some(33300i128)]).to(DataType::Decimal(5, 2));
+/// let expected = PrimitiveArray::from([None, Some(33300i128), None, Some(33300i128)]).to(DataType::Decimal(5, 2));
 ///
 /// assert_eq!(result, expected);
 /// ```
@@ -242,10 +242,10 @@ impl ArraySaturatingAdd<PrimitiveArray<i128>> for PrimitiveArray<i128> {
 /// use arrow2::array::PrimitiveArray;
 /// use arrow2::datatypes::DataType;
 ///
-/// let a = PrimitiveArray::from(&vec![Some(11111_11i128)]).to(DataType::Decimal(7, 2));
-/// let b = PrimitiveArray::from(&vec![Some(11111_111i128)]).to(DataType::Decimal(8, 3));
+/// let a = PrimitiveArray::from([Some(11111_11i128)]).to(DataType::Decimal(7, 2));
+/// let b = PrimitiveArray::from([Some(11111_111i128)]).to(DataType::Decimal(8, 3));
 /// let result = adaptive_add(&a, &b).unwrap();
-/// let expected = PrimitiveArray::from(&vec![Some(22222_221i128)]).to(DataType::Decimal(8, 3));
+/// let expected = PrimitiveArray::from([Some(22222_221i128)]).to(DataType::Decimal(8, 3));
 ///
 /// assert_eq!(result, expected);
 /// ```
@@ -316,30 +316,16 @@ mod tests {
 
     #[test]
     fn test_add_normal() {
-        let a = PrimitiveArray::from(&vec![
-            Some(11111i128),
-            Some(11100i128),
-            None,
-            Some(22200i128),
-        ])
-        .to(DataType::Decimal(5, 2));
+        let a = PrimitiveArray::from([Some(11111i128), Some(11100i128), None, Some(22200i128)])
+            .to(DataType::Decimal(5, 2));
 
-        let b = PrimitiveArray::from(&vec![
-            Some(22222i128),
-            Some(22200i128),
-            None,
-            Some(11100i128),
-        ])
-        .to(DataType::Decimal(5, 2));
+        let b = PrimitiveArray::from([Some(22222i128), Some(22200i128), None, Some(11100i128)])
+            .to(DataType::Decimal(5, 2));
 
         let result = add(&a, &b).unwrap();
-        let expected = PrimitiveArray::from(&vec![
-            Some(33333i128),
-            Some(33300i128),
-            None,
-            Some(33300i128),
-        ])
-        .to(DataType::Decimal(5, 2));
+        let expected =
+            PrimitiveArray::from([Some(33333i128), Some(33300i128), None, Some(33300i128)])
+                .to(DataType::Decimal(5, 2));
 
         assert_eq!(result, expected);
 
@@ -350,8 +336,8 @@ mod tests {
 
     #[test]
     fn test_add_decimal_wrong_precision() {
-        let a = PrimitiveArray::from(&vec![None]).to(DataType::Decimal(5, 2));
-        let b = PrimitiveArray::from(&vec![None]).to(DataType::Decimal(6, 2));
+        let a = PrimitiveArray::from([None]).to(DataType::Decimal(5, 2));
+        let b = PrimitiveArray::from([None]).to(DataType::Decimal(6, 2));
         let result = add(&a, &b);
 
         if result.is_ok() {
@@ -362,37 +348,23 @@ mod tests {
     #[test]
     #[should_panic(expected = "Overflow in addition presented for precision 5")]
     fn test_add_panic() {
-        let a = PrimitiveArray::from(&vec![Some(99999i128)]).to(DataType::Decimal(5, 2));
-        let b = PrimitiveArray::from(&vec![Some(1i128)]).to(DataType::Decimal(5, 2));
+        let a = PrimitiveArray::from([Some(99999i128)]).to(DataType::Decimal(5, 2));
+        let b = PrimitiveArray::from([Some(1i128)]).to(DataType::Decimal(5, 2));
         let _ = add(&a, &b);
     }
 
     #[test]
     fn test_add_saturating() {
-        let a = PrimitiveArray::from(&vec![
-            Some(11111i128),
-            Some(11100i128),
-            None,
-            Some(22200i128),
-        ])
-        .to(DataType::Decimal(5, 2));
+        let a = PrimitiveArray::from([Some(11111i128), Some(11100i128), None, Some(22200i128)])
+            .to(DataType::Decimal(5, 2));
 
-        let b = PrimitiveArray::from(&vec![
-            Some(22222i128),
-            Some(22200i128),
-            None,
-            Some(11100i128),
-        ])
-        .to(DataType::Decimal(5, 2));
+        let b = PrimitiveArray::from([Some(22222i128), Some(22200i128), None, Some(11100i128)])
+            .to(DataType::Decimal(5, 2));
 
         let result = saturating_add(&a, &b).unwrap();
-        let expected = PrimitiveArray::from(&vec![
-            Some(33333i128),
-            Some(33300i128),
-            None,
-            Some(33300i128),
-        ])
-        .to(DataType::Decimal(5, 2));
+        let expected =
+            PrimitiveArray::from([Some(33333i128), Some(33300i128), None, Some(33300i128)])
+                .to(DataType::Decimal(5, 2));
 
         assert_eq!(result, expected);
 
@@ -403,14 +375,14 @@ mod tests {
 
     #[test]
     fn test_add_saturating_overflow() {
-        let a = PrimitiveArray::from(&vec![
+        let a = PrimitiveArray::from([
             Some(99999i128),
             Some(99999i128),
             Some(99999i128),
             Some(-99999i128),
         ])
         .to(DataType::Decimal(5, 2));
-        let b = PrimitiveArray::from(&vec![
+        let b = PrimitiveArray::from([
             Some(00001i128),
             Some(00100i128),
             Some(10000i128),
@@ -420,7 +392,7 @@ mod tests {
 
         let result = saturating_add(&a, &b).unwrap();
 
-        let expected = PrimitiveArray::from(&vec![
+        let expected = PrimitiveArray::from([
             Some(99999i128),
             Some(99999i128),
             Some(99999i128),
@@ -437,30 +409,16 @@ mod tests {
 
     #[test]
     fn test_add_checked() {
-        let a = PrimitiveArray::from(&vec![
-            Some(11111i128),
-            Some(11100i128),
-            None,
-            Some(22200i128),
-        ])
-        .to(DataType::Decimal(5, 2));
+        let a = PrimitiveArray::from([Some(11111i128), Some(11100i128), None, Some(22200i128)])
+            .to(DataType::Decimal(5, 2));
 
-        let b = PrimitiveArray::from(&vec![
-            Some(22222i128),
-            Some(22200i128),
-            None,
-            Some(11100i128),
-        ])
-        .to(DataType::Decimal(5, 2));
+        let b = PrimitiveArray::from([Some(22222i128), Some(22200i128), None, Some(11100i128)])
+            .to(DataType::Decimal(5, 2));
 
         let result = checked_add(&a, &b).unwrap();
-        let expected = PrimitiveArray::from(&vec![
-            Some(33333i128),
-            Some(33300i128),
-            None,
-            Some(33300i128),
-        ])
-        .to(DataType::Decimal(5, 2));
+        let expected =
+            PrimitiveArray::from([Some(33333i128), Some(33300i128), None, Some(33300i128)])
+                .to(DataType::Decimal(5, 2));
 
         assert_eq!(result, expected);
 
@@ -471,11 +429,10 @@ mod tests {
 
     #[test]
     fn test_add_checked_overflow() {
-        let a =
-            PrimitiveArray::from(&vec![Some(1i128), Some(99999i128)]).to(DataType::Decimal(5, 2));
-        let b = PrimitiveArray::from(&vec![Some(1i128), Some(1i128)]).to(DataType::Decimal(5, 2));
+        let a = PrimitiveArray::from([Some(1i128), Some(99999i128)]).to(DataType::Decimal(5, 2));
+        let b = PrimitiveArray::from([Some(1i128), Some(1i128)]).to(DataType::Decimal(5, 2));
         let result = checked_add(&a, &b).unwrap();
-        let expected = PrimitiveArray::from(&vec![Some(2i128), None]).to(DataType::Decimal(5, 2));
+        let expected = PrimitiveArray::from([Some(2i128), None]).to(DataType::Decimal(5, 2));
         assert_eq!(result, expected);
 
         // Testing trait
@@ -489,12 +446,11 @@ mod tests {
         // 11111.11   -> 7, 2
         // -----------------
         // 11122.2211 -> 9, 4
-        let a = PrimitiveArray::from(&vec![Some(11_1111i128)]).to(DataType::Decimal(6, 4));
-        let b = PrimitiveArray::from(&vec![Some(11111_11i128)]).to(DataType::Decimal(7, 2));
+        let a = PrimitiveArray::from([Some(11_1111i128)]).to(DataType::Decimal(6, 4));
+        let b = PrimitiveArray::from([Some(11111_11i128)]).to(DataType::Decimal(7, 2));
         let result = adaptive_add(&a, &b).unwrap();
 
-        let expected =
-            PrimitiveArray::from(&vec![Some(11122_2211i128)]).to(DataType::Decimal(9, 4));
+        let expected = PrimitiveArray::from([Some(11122_2211i128)]).to(DataType::Decimal(9, 4));
 
         assert_eq!(result, expected);
         assert_eq!(result.data_type(), &DataType::Decimal(9, 4));
@@ -503,12 +459,11 @@ mod tests {
         // 11111.0    -> 6, 1
         // -----------------
         // 11111.1111 -> 9, 4
-        let a = PrimitiveArray::from(&vec![Some(1111i128)]).to(DataType::Decimal(5, 4));
-        let b = PrimitiveArray::from(&vec![Some(11111_0i128)]).to(DataType::Decimal(6, 1));
+        let a = PrimitiveArray::from([Some(1111i128)]).to(DataType::Decimal(5, 4));
+        let b = PrimitiveArray::from([Some(11111_0i128)]).to(DataType::Decimal(6, 1));
         let result = adaptive_add(&a, &b).unwrap();
 
-        let expected =
-            PrimitiveArray::from(&vec![Some(11111_1111i128)]).to(DataType::Decimal(9, 4));
+        let expected = PrimitiveArray::from([Some(11111_1111i128)]).to(DataType::Decimal(9, 4));
 
         assert_eq!(result, expected);
         assert_eq!(result.data_type(), &DataType::Decimal(9, 4));
@@ -517,11 +472,11 @@ mod tests {
         // 11111.111  -> 8, 3
         // -----------------
         // 22222.221  -> 8, 3
-        let a = PrimitiveArray::from(&vec![Some(11111_11i128)]).to(DataType::Decimal(7, 2));
-        let b = PrimitiveArray::from(&vec![Some(11111_111i128)]).to(DataType::Decimal(8, 3));
+        let a = PrimitiveArray::from([Some(11111_11i128)]).to(DataType::Decimal(7, 2));
+        let b = PrimitiveArray::from([Some(11111_111i128)]).to(DataType::Decimal(8, 3));
         let result = adaptive_add(&a, &b).unwrap();
 
-        let expected = PrimitiveArray::from(&vec![Some(22222_221i128)]).to(DataType::Decimal(8, 3));
+        let expected = PrimitiveArray::from([Some(22222_221i128)]).to(DataType::Decimal(8, 3));
 
         assert_eq!(result, expected);
         assert_eq!(result.data_type(), &DataType::Decimal(8, 3));
@@ -530,11 +485,11 @@ mod tests {
         //  00.0001 -> 6, 4
         // -----------------
         // 100.0000 -> 7, 4
-        let a = PrimitiveArray::from(&vec![Some(99_9999i128)]).to(DataType::Decimal(6, 4));
-        let b = PrimitiveArray::from(&vec![Some(00_0001i128)]).to(DataType::Decimal(6, 4));
+        let a = PrimitiveArray::from([Some(99_9999i128)]).to(DataType::Decimal(6, 4));
+        let b = PrimitiveArray::from([Some(00_0001i128)]).to(DataType::Decimal(6, 4));
         let result = adaptive_add(&a, &b).unwrap();
 
-        let expected = PrimitiveArray::from(&vec![Some(100_0000i128)]).to(DataType::Decimal(7, 4));
+        let expected = PrimitiveArray::from([Some(100_0000i128)]).to(DataType::Decimal(7, 4));
 
         assert_eq!(result, expected);
         assert_eq!(result.data_type(), &DataType::Decimal(7, 4));
diff --git a/src/compute/arithmetics/decimal/div.rs b/src/compute/arithmetics/decimal/div.rs
index 92e8b077fd..65e9b2863a 100644
--- a/src/compute/arithmetics/decimal/div.rs
+++ b/src/compute/arithmetics/decimal/div.rs
@@ -46,11 +46,11 @@ use super::{adjusted_precision_scale, max_value, number_digits};
 /// use arrow2::array::PrimitiveArray;
 /// use arrow2::datatypes::DataType;
 ///
-/// let a = PrimitiveArray::from(&vec![Some(1_00i128), Some(4_00i128), Some(6_00i128)]).to(DataType::Decimal(5, 2));
-/// let b = PrimitiveArray::from(&vec![Some(1_00i128), Some(2_00i128), Some(2_00i128)]).to(DataType::Decimal(5, 2));
+/// let a = PrimitiveArray::from([Some(1_00i128), Some(4_00i128), Some(6_00i128)]).to(DataType::Decimal(5, 2));
+/// let b = PrimitiveArray::from([Some(1_00i128), Some(2_00i128), Some(2_00i128)]).to(DataType::Decimal(5, 2));
 ///
 /// let result = div(&a, &b).unwrap();
-/// let expected = PrimitiveArray::from(&vec![Some(1_00i128), Some(2_00i128), Some(3_00i128)]).to(DataType::Decimal(5, 2));
+/// let expected = PrimitiveArray::from([Some(1_00i128), Some(2_00i128), Some(3_00i128)]).to(DataType::Decimal(5, 2));
 ///
 /// assert_eq!(result, expected);
 /// ```
@@ -115,11 +115,11 @@ pub fn div(lhs: &PrimitiveArray<i128>, rhs: &PrimitiveArray<i128>) -> Result<Pri
 /// use arrow2::array::PrimitiveArray;
 /// use arrow2::datatypes::DataType;
 ///
-/// let a = PrimitiveArray::from(&vec![Some(999_99i128), Some(4_00i128), Some(6_00i128)]).to(DataType::Decimal(5, 2));
-/// let b = PrimitiveArray::from(&vec![Some(000_01i128), Some(2_00i128), Some(2_00i128)]).to(DataType::Decimal(5, 2));
+/// let a = PrimitiveArray::from([Some(999_99i128), Some(4_00i128), Some(6_00i128)]).to(DataType::Decimal(5, 2));
+/// let b = PrimitiveArray::from([Some(000_01i128), Some(2_00i128), Some(2_00i128)]).to(DataType::Decimal(5, 2));
 ///
 /// let result = saturating_div(&a, &b).unwrap();
-/// let expected = PrimitiveArray::from(&vec![Some(999_99i128), Some(2_00i128), Some(3_00i128)]).to(DataType::Decimal(5, 2));
+/// let expected = PrimitiveArray::from([Some(999_99i128), Some(2_00i128), Some(3_00i128)]).to(DataType::Decimal(5, 2));
 ///
 /// assert_eq!(result, expected);
 /// ```
@@ -180,11 +180,11 @@ pub fn saturating_div(
 /// use arrow2::array::PrimitiveArray;
 /// use arrow2::datatypes::DataType;
 ///
-/// let a = PrimitiveArray::from(&vec![Some(1_00i128), Some(4_00i128), Some(6_00i128)]).to(DataType::Decimal(5, 2));
-/// let b = PrimitiveArray::from(&vec![Some(000_00i128), None, Some(2_00i128)]).to(DataType::Decimal(5, 2));
+/// let a = PrimitiveArray::from([Some(1_00i128), Some(4_00i128), Some(6_00i128)]).to(DataType::Decimal(5, 2));
+/// let b = PrimitiveArray::from([Some(000_00i128), None, Some(2_00i128)]).to(DataType::Decimal(5, 2));
 ///
 /// let result = checked_div(&a, &b).unwrap();
-/// let expected = PrimitiveArray::from(&vec![None, None, Some(3_00i128)]).to(DataType::Decimal(5, 2));
+/// let expected = PrimitiveArray::from([None, None, Some(3_00i128)]).to(DataType::Decimal(5, 2));
 ///
 /// assert_eq!(result, expected);
 /// ```
@@ -261,10 +261,10 @@ impl ArrayCheckedDiv<PrimitiveArray<i128>> for PrimitiveArray<i128> {
 /// use arrow2::array::PrimitiveArray;
 /// use arrow2::datatypes::DataType;
 ///
-/// let a = PrimitiveArray::from(&vec![Some(1000_00i128)]).to(DataType::Decimal(7, 2));
-/// let b = PrimitiveArray::from(&vec![Some(10_0000i128)]).to(DataType::Decimal(6, 4));
+/// let a = PrimitiveArray::from([Some(1000_00i128)]).to(DataType::Decimal(7, 2));
+/// let b = PrimitiveArray::from([Some(10_0000i128)]).to(DataType::Decimal(6, 4));
 /// let result = adaptive_div(&a, &b).unwrap();
-/// let expected = PrimitiveArray::from(&vec![Some(100_0000i128)]).to(DataType::Decimal(9, 4));
+/// let expected = PrimitiveArray::from([Some(100_0000i128)]).to(DataType::Decimal(9, 4));
 ///
 /// assert_eq!(result, expected);
 /// ```
@@ -345,7 +345,7 @@ mod tests {
         //   123.456 -->     123456
         // --------       ---------
         //     1.800 <--       1800
-        let a = PrimitiveArray::from(&vec![
+        let a = PrimitiveArray::from([
             Some(222_222i128),
             Some(10_000i128),
             Some(20_000i128),
@@ -355,7 +355,7 @@ mod tests {
         ])
         .to(DataType::Decimal(7, 3));
 
-        let b = PrimitiveArray::from(&vec![
+        let b = PrimitiveArray::from([
             Some(123_456i128),
             Some(2_000i128),
             Some(3_000i128),
@@ -366,7 +366,7 @@ mod tests {
         .to(DataType::Decimal(7, 3));
 
         let result = div(&a, &b).unwrap();
-        let expected = PrimitiveArray::from(&vec![
+        let expected = PrimitiveArray::from([
             Some(1_800i128),
             Some(5_000i128),
             Some(6_666i128),
@@ -385,8 +385,8 @@ mod tests {
 
     #[test]
     fn test_divide_decimal_wrong_precision() {
-        let a = PrimitiveArray::from(&vec![None]).to(DataType::Decimal(5, 2));
-        let b = PrimitiveArray::from(&vec![None]).to(DataType::Decimal(6, 2));
+        let a = PrimitiveArray::from([None]).to(DataType::Decimal(5, 2));
+        let b = PrimitiveArray::from([None]).to(DataType::Decimal(6, 2));
         let result = div(&a, &b);
 
         if result.is_ok() {
@@ -397,14 +397,14 @@ mod tests {
     #[test]
     #[should_panic(expected = "Overflow in multiplication presented for precision 5")]
     fn test_divide_panic() {
-        let a = PrimitiveArray::from(&vec![Some(99999i128)]).to(DataType::Decimal(5, 2));
-        let b = PrimitiveArray::from(&vec![Some(000_01i128)]).to(DataType::Decimal(5, 2));
+        let a = PrimitiveArray::from([Some(99999i128)]).to(DataType::Decimal(5, 2));
+        let b = PrimitiveArray::from([Some(000_01i128)]).to(DataType::Decimal(5, 2));
         let _ = div(&a, &b);
     }
 
     #[test]
     fn test_divide_saturating() {
-        let a = PrimitiveArray::from(&vec![
+        let a = PrimitiveArray::from([
             Some(222_222i128),
             Some(10_000i128),
             Some(20_000i128),
@@ -414,7 +414,7 @@ mod tests {
         ])
         .to(DataType::Decimal(7, 3));
 
-        let b = PrimitiveArray::from(&vec![
+        let b = PrimitiveArray::from([
             Some(123_456i128),
             Some(2_000i128),
             Some(3_000i128),
@@ -425,7 +425,7 @@ mod tests {
         .to(DataType::Decimal(7, 3));
 
         let result = saturating_div(&a, &b).unwrap();
-        let expected = PrimitiveArray::from(&vec![
+        let expected = PrimitiveArray::from([
             Some(1_800i128),
             Some(5_000i128),
             Some(6_666i128),
@@ -440,7 +440,7 @@ mod tests {
 
     #[test]
     fn test_divide_saturating_overflow() {
-        let a = PrimitiveArray::from(&vec![
+        let a = PrimitiveArray::from([
             Some(99999i128),
             Some(99999i128),
             Some(99999i128),
@@ -448,7 +448,7 @@ mod tests {
             Some(99999i128),
         ])
         .to(DataType::Decimal(5, 2));
-        let b = PrimitiveArray::from(&vec![
+        let b = PrimitiveArray::from([
             Some(-00001i128),
             Some(00001i128),
             Some(00010i128),
@@ -459,7 +459,7 @@ mod tests {
 
         let result = saturating_div(&a, &b).unwrap();
 
-        let expected = PrimitiveArray::from(&vec![
+        let expected = PrimitiveArray::from([
             Some(-99999i128),
             Some(99999i128),
             Some(99999i128),
@@ -473,7 +473,7 @@ mod tests {
 
     #[test]
     fn test_divide_checked() {
-        let a = PrimitiveArray::from(&vec![
+        let a = PrimitiveArray::from([
             Some(222_222i128),
             Some(10_000i128),
             Some(20_000i128),
@@ -483,7 +483,7 @@ mod tests {
         ])
         .to(DataType::Decimal(7, 3));
 
-        let b = PrimitiveArray::from(&vec![
+        let b = PrimitiveArray::from([
             Some(123_456i128),
             Some(2_000i128),
             Some(3_000i128),
@@ -494,7 +494,7 @@ mod tests {
         .to(DataType::Decimal(7, 3));
 
         let result = div(&a, &b).unwrap();
-        let expected = PrimitiveArray::from(&vec![
+        let expected = PrimitiveArray::from([
             Some(1_800i128),
             Some(5_000i128),
             Some(6_666i128),
@@ -509,14 +509,14 @@ mod tests {
 
     #[test]
     fn test_divide_checked_overflow() {
-        let a = PrimitiveArray::from(&vec![Some(1_00i128), Some(4_00i128), Some(6_00i128)])
+        let a = PrimitiveArray::from([Some(1_00i128), Some(4_00i128), Some(6_00i128)])
             .to(DataType::Decimal(5, 2));
-        let b = PrimitiveArray::from(&vec![Some(000_00i128), None, Some(2_00i128)])
+        let b = PrimitiveArray::from([Some(000_00i128), None, Some(2_00i128)])
             .to(DataType::Decimal(5, 2));
 
         let result = checked_div(&a, &b).unwrap();
         let expected =
-            PrimitiveArray::from(&vec![None, None, Some(3_00i128)]).to(DataType::Decimal(5, 2));
+            PrimitiveArray::from([None, None, Some(3_00i128)]).to(DataType::Decimal(5, 2));
 
         assert_eq!(result, expected);
 
@@ -531,11 +531,11 @@ mod tests {
         //    10.0000 -> 6, 4
         // -----------------
         //   100.0000 -> 9, 4
-        let a = PrimitiveArray::from(&vec![Some(1000_00i128)]).to(DataType::Decimal(7, 2));
-        let b = PrimitiveArray::from(&vec![Some(10_0000i128)]).to(DataType::Decimal(6, 4));
+        let a = PrimitiveArray::from([Some(1000_00i128)]).to(DataType::Decimal(7, 2));
+        let b = PrimitiveArray::from([Some(10_0000i128)]).to(DataType::Decimal(6, 4));
         let result = adaptive_div(&a, &b).unwrap();
 
-        let expected = PrimitiveArray::from(&vec![Some(100_0000i128)]).to(DataType::Decimal(9, 4));
+        let expected = PrimitiveArray::from([Some(100_0000i128)]).to(DataType::Decimal(9, 4));
 
         assert_eq!(result, expected);
         assert_eq!(result.data_type(), &DataType::Decimal(9, 4));
@@ -544,11 +544,11 @@ mod tests {
         //      10.002  -> 5, 3
         // -----------------
         //    1110.877  -> 8, 3
-        let a = PrimitiveArray::from(&vec![Some(11111_0i128)]).to(DataType::Decimal(6, 1));
-        let b = PrimitiveArray::from(&vec![Some(10_002i128)]).to(DataType::Decimal(5, 3));
+        let a = PrimitiveArray::from([Some(11111_0i128)]).to(DataType::Decimal(6, 1));
+        let b = PrimitiveArray::from([Some(10_002i128)]).to(DataType::Decimal(5, 3));
         let result = adaptive_div(&a, &b).unwrap();
 
-        let expected = PrimitiveArray::from(&vec![Some(1110_877i128)]).to(DataType::Decimal(8, 3));
+        let expected = PrimitiveArray::from([Some(1110_877i128)]).to(DataType::Decimal(8, 3));
 
         assert_eq!(result, expected);
         assert_eq!(result.data_type(), &DataType::Decimal(8, 3));
@@ -557,11 +557,11 @@ mod tests {
         //     12345.678  ->  8, 3
         // -----------------
         //         0.999  ->  8, 3
-        let a = PrimitiveArray::from(&vec![Some(12345_67i128)]).to(DataType::Decimal(7, 2));
-        let b = PrimitiveArray::from(&vec![Some(12345_678i128)]).to(DataType::Decimal(8, 3));
+        let a = PrimitiveArray::from([Some(12345_67i128)]).to(DataType::Decimal(7, 2));
+        let b = PrimitiveArray::from([Some(12345_678i128)]).to(DataType::Decimal(8, 3));
         let result = adaptive_div(&a, &b).unwrap();
 
-        let expected = PrimitiveArray::from(&vec![Some(0_999i128)]).to(DataType::Decimal(8, 3));
+        let expected = PrimitiveArray::from([Some(0_999i128)]).to(DataType::Decimal(8, 3));
 
         assert_eq!(result, expected);
         assert_eq!(result.data_type(), &DataType::Decimal(8, 3));
diff --git a/src/compute/arithmetics/decimal/mul.rs b/src/compute/arithmetics/decimal/mul.rs
index b33a2e1fea..0447e6e96a 100644
--- a/src/compute/arithmetics/decimal/mul.rs
+++ b/src/compute/arithmetics/decimal/mul.rs
@@ -43,11 +43,11 @@ use super::{adjusted_precision_scale, max_value, number_digits};
 /// use arrow2::array::PrimitiveArray;
 /// use arrow2::datatypes::DataType;
 ///
-/// let a = PrimitiveArray::from(&vec![Some(1_00i128), Some(1_00i128), None, Some(2_00i128)]).to(DataType::Decimal(5, 2));
-/// let b = PrimitiveArray::from(&vec![Some(1_00i128), Some(2_00i128), None, Some(2_00i128)]).to(DataType::Decimal(5, 2));
+/// let a = PrimitiveArray::from([Some(1_00i128), Some(1_00i128), None, Some(2_00i128)]).to(DataType::Decimal(5, 2));
+/// let b = PrimitiveArray::from([Some(1_00i128), Some(2_00i128), None, Some(2_00i128)]).to(DataType::Decimal(5, 2));
 ///
 /// let result = mul(&a, &b).unwrap();
-/// let expected = PrimitiveArray::from(&vec![Some(1_00i128), Some(2_00i128), None, Some(4_00i128)]).to(DataType::Decimal(5, 2));
+/// let expected = PrimitiveArray::from([Some(1_00i128), Some(2_00i128), None, Some(4_00i128)]).to(DataType::Decimal(5, 2));
 ///
 /// assert_eq!(result, expected);
 /// ```
@@ -113,11 +113,11 @@ pub fn mul(lhs: &PrimitiveArray<i128>, rhs: &PrimitiveArray<i128>) -> Result<Pri
 /// use arrow2::array::PrimitiveArray;
 /// use arrow2::datatypes::DataType;
 ///
-/// let a = PrimitiveArray::from(&vec![Some(999_99i128), Some(1_00i128), None, Some(2_00i128)]).to(DataType::Decimal(5, 2));
-/// let b = PrimitiveArray::from(&vec![Some(10_00i128), Some(2_00i128), None, Some(2_00i128)]).to(DataType::Decimal(5, 2));
+/// let a = PrimitiveArray::from([Some(999_99i128), Some(1_00i128), None, Some(2_00i128)]).to(DataType::Decimal(5, 2));
+/// let b = PrimitiveArray::from([Some(10_00i128), Some(2_00i128), None, Some(2_00i128)]).to(DataType::Decimal(5, 2));
 ///
 /// let result = saturating_mul(&a, &b).unwrap();
-/// let expected = PrimitiveArray::from(&vec![Some(999_99i128), Some(2_00i128), None, Some(4_00i128)]).to(DataType::Decimal(5, 2));
+/// let expected = PrimitiveArray::from([Some(999_99i128), Some(2_00i128), None, Some(4_00i128)]).to(DataType::Decimal(5, 2));
 ///
 /// assert_eq!(result, expected);
 /// ```
@@ -176,11 +176,11 @@ pub fn saturating_mul(
 /// use arrow2::array::PrimitiveArray;
 /// use arrow2::datatypes::DataType;
 ///
-/// let a = PrimitiveArray::from(&vec![Some(999_99i128), Some(1_00i128), None, Some(2_00i128)]).to(DataType::Decimal(5, 2));
-/// let b = PrimitiveArray::from(&vec![Some(10_00i128), Some(2_00i128), None, Some(2_00i128)]).to(DataType::Decimal(5, 2));
+/// let a = PrimitiveArray::from([Some(999_99i128), Some(1_00i128), None, Some(2_00i128)]).to(DataType::Decimal(5, 2));
+/// let b = PrimitiveArray::from([Some(10_00i128), Some(2_00i128), None, Some(2_00i128)]).to(DataType::Decimal(5, 2));
 ///
 /// let result = checked_mul(&a, &b).unwrap();
-/// let expected = PrimitiveArray::from(&vec![None, Some(2_00i128), None, Some(4_00i128)]).to(DataType::Decimal(5, 2));
+/// let expected = PrimitiveArray::from([None, Some(2_00i128), None, Some(4_00i128)]).to(DataType::Decimal(5, 2));
 ///
 /// assert_eq!(result, expected);
 /// ```
@@ -266,10 +266,10 @@ impl ArraySaturatingMul<PrimitiveArray<i128>> for PrimitiveArray<i128> {
 /// use arrow2::array::PrimitiveArray;
 /// use arrow2::datatypes::DataType;
 ///
-/// let a = PrimitiveArray::from(&vec![Some(11111_0i128), Some(1_0i128)]).to(DataType::Decimal(6, 1));
-/// let b = PrimitiveArray::from(&vec![Some(10_002i128), Some(2_000i128)]).to(DataType::Decimal(5, 3));
+/// let a = PrimitiveArray::from([Some(11111_0i128), Some(1_0i128)]).to(DataType::Decimal(6, 1));
+/// let b = PrimitiveArray::from([Some(10_002i128), Some(2_000i128)]).to(DataType::Decimal(5, 3));
 /// let result = adaptive_mul(&a, &b).unwrap();
-/// let expected = PrimitiveArray::from(&vec![Some(111132_222i128), Some(2_000i128)]).to(DataType::Decimal(9, 3));
+/// let expected = PrimitiveArray::from([Some(111132_222i128), Some(2_000i128)]).to(DataType::Decimal(9, 3));
 ///
 /// assert_eq!(result, expected);
 /// ```
@@ -349,7 +349,7 @@ mod tests {
         //   222.22 -->     22222
         // --------       -------
         // 24690.86 <-- 246908642
-        let a = PrimitiveArray::from(&vec![
+        let a = PrimitiveArray::from([
             Some(111_11i128),
             Some(10_00i128),
             Some(20_00i128),
@@ -359,7 +359,7 @@ mod tests {
         ])
         .to(DataType::Decimal(7, 2));
 
-        let b = PrimitiveArray::from(&vec![
+        let b = PrimitiveArray::from([
             Some(222_22i128),
             Some(2_00i128),
             Some(3_00i128),
@@ -370,7 +370,7 @@ mod tests {
         .to(DataType::Decimal(7, 2));
 
         let result = mul(&a, &b).unwrap();
-        let expected = PrimitiveArray::from(&vec![
+        let expected = PrimitiveArray::from([
             Some(24690_86i128),
             Some(20_00i128),
             Some(60_00i128),
@@ -389,8 +389,8 @@ mod tests {
 
     #[test]
     fn test_multiply_decimal_wrong_precision() {
-        let a = PrimitiveArray::from(&vec![None]).to(DataType::Decimal(5, 2));
-        let b = PrimitiveArray::from(&vec![None]).to(DataType::Decimal(6, 2));
+        let a = PrimitiveArray::from([None]).to(DataType::Decimal(5, 2));
+        let b = PrimitiveArray::from([None]).to(DataType::Decimal(6, 2));
         let result = mul(&a, &b);
 
         if result.is_ok() {
@@ -401,14 +401,14 @@ mod tests {
     #[test]
     #[should_panic(expected = "Overflow in multiplication presented for precision 5")]
     fn test_multiply_panic() {
-        let a = PrimitiveArray::from(&vec![Some(99999i128)]).to(DataType::Decimal(5, 2));
-        let b = PrimitiveArray::from(&vec![Some(100_00i128)]).to(DataType::Decimal(5, 2));
+        let a = PrimitiveArray::from([Some(99999i128)]).to(DataType::Decimal(5, 2));
+        let b = PrimitiveArray::from([Some(100_00i128)]).to(DataType::Decimal(5, 2));
         let _ = mul(&a, &b);
     }
 
     #[test]
     fn test_multiply_saturating() {
-        let a = PrimitiveArray::from(&vec![
+        let a = PrimitiveArray::from([
             Some(111_11i128),
             Some(10_00i128),
             Some(20_00i128),
@@ -418,7 +418,7 @@ mod tests {
         ])
         .to(DataType::Decimal(7, 2));
 
-        let b = PrimitiveArray::from(&vec![
+        let b = PrimitiveArray::from([
             Some(222_22i128),
             Some(2_00i128),
             Some(3_00i128),
@@ -429,7 +429,7 @@ mod tests {
         .to(DataType::Decimal(7, 2));
 
         let result = saturating_mul(&a, &b).unwrap();
-        let expected = PrimitiveArray::from(&vec![
+        let expected = PrimitiveArray::from([
             Some(24690_86i128),
             Some(20_00i128),
             Some(60_00i128),
@@ -448,14 +448,14 @@ mod tests {
 
     #[test]
     fn test_multiply_saturating_overflow() {
-        let a = PrimitiveArray::from(&vec![
+        let a = PrimitiveArray::from([
             Some(99999i128),
             Some(99999i128),
             Some(99999i128),
             Some(99999i128),
         ])
         .to(DataType::Decimal(5, 2));
-        let b = PrimitiveArray::from(&vec![
+        let b = PrimitiveArray::from([
             Some(-00100i128),
             Some(01000i128),
             Some(10000i128),
@@ -465,7 +465,7 @@ mod tests {
 
         let result = saturating_mul(&a, &b).unwrap();
 
-        let expected = PrimitiveArray::from(&vec![
+        let expected = PrimitiveArray::from([
             Some(-99999i128),
             Some(99999i128),
             Some(99999i128),
@@ -482,7 +482,7 @@ mod tests {
 
     #[test]
     fn test_multiply_checked() {
-        let a = PrimitiveArray::from(&vec![
+        let a = PrimitiveArray::from([
             Some(111_11i128),
             Some(10_00i128),
             Some(20_00i128),
@@ -492,7 +492,7 @@ mod tests {
         ])
         .to(DataType::Decimal(7, 2));
 
-        let b = PrimitiveArray::from(&vec![
+        let b = PrimitiveArray::from([
             Some(222_22i128),
             Some(2_00i128),
             Some(3_00i128),
@@ -503,7 +503,7 @@ mod tests {
         .to(DataType::Decimal(7, 2));
 
         let result = checked_mul(&a, &b).unwrap();
-        let expected = PrimitiveArray::from(&vec![
+        let expected = PrimitiveArray::from([
             Some(24690_86i128),
             Some(20_00i128),
             Some(60_00i128),
@@ -522,13 +522,10 @@ mod tests {
 
     #[test]
     fn test_multiply_checked_overflow() {
-        let a = PrimitiveArray::from(&vec![Some(99999i128), Some(1_00i128)])
-            .to(DataType::Decimal(5, 2));
-        let b = PrimitiveArray::from(&vec![Some(10000i128), Some(2_00i128)])
-            .to(DataType::Decimal(5, 2));
+        let a = PrimitiveArray::from([Some(99999i128), Some(1_00i128)]).to(DataType::Decimal(5, 2));
+        let b = PrimitiveArray::from([Some(10000i128), Some(2_00i128)]).to(DataType::Decimal(5, 2));
         let result = checked_mul(&a, &b).unwrap();
-        let expected =
-            PrimitiveArray::from(&vec![None, Some(2_00i128)]).to(DataType::Decimal(5, 2));
+        let expected = PrimitiveArray::from([None, Some(2_00i128)]).to(DataType::Decimal(5, 2));
 
         assert_eq!(result, expected);
     }
@@ -539,12 +536,11 @@ mod tests {
         //    10.0000 -> 6, 4
         // -----------------
         // 10000.0000 -> 9, 4
-        let a = PrimitiveArray::from(&vec![Some(1000_00i128)]).to(DataType::Decimal(7, 2));
-        let b = PrimitiveArray::from(&vec![Some(10_0000i128)]).to(DataType::Decimal(6, 4));
+        let a = PrimitiveArray::from([Some(1000_00i128)]).to(DataType::Decimal(7, 2));
+        let b = PrimitiveArray::from([Some(10_0000i128)]).to(DataType::Decimal(6, 4));
         let result = adaptive_mul(&a, &b).unwrap();
 
-        let expected =
-            PrimitiveArray::from(&vec![Some(10000_0000i128)]).to(DataType::Decimal(9, 4));
+        let expected = PrimitiveArray::from([Some(10000_0000i128)]).to(DataType::Decimal(9, 4));
 
         assert_eq!(result, expected);
         assert_eq!(result.data_type(), &DataType::Decimal(9, 4));
@@ -553,12 +549,11 @@ mod tests {
         //      10.002  -> 5, 3
         // -----------------
         //  111132.222  -> 9, 3
-        let a = PrimitiveArray::from(&vec![Some(11111_0i128)]).to(DataType::Decimal(6, 1));
-        let b = PrimitiveArray::from(&vec![Some(10_002i128)]).to(DataType::Decimal(5, 3));
+        let a = PrimitiveArray::from([Some(11111_0i128)]).to(DataType::Decimal(6, 1));
+        let b = PrimitiveArray::from([Some(10_002i128)]).to(DataType::Decimal(5, 3));
         let result = adaptive_mul(&a, &b).unwrap();
 
-        let expected =
-            PrimitiveArray::from(&vec![Some(111132_222i128)]).to(DataType::Decimal(9, 3));
+        let expected = PrimitiveArray::from([Some(111132_222i128)]).to(DataType::Decimal(9, 3));
 
         assert_eq!(result, expected);
         assert_eq!(result.data_type(), &DataType::Decimal(9, 3));
@@ -567,12 +562,11 @@ mod tests {
         //     12345.678  ->  8, 3
         // -----------------
         // 152415666.514  -> 11, 3
-        let a = PrimitiveArray::from(&vec![Some(12345_67i128)]).to(DataType::Decimal(7, 2));
-        let b = PrimitiveArray::from(&vec![Some(12345_678i128)]).to(DataType::Decimal(8, 3));
+        let a = PrimitiveArray::from([Some(12345_67i128)]).to(DataType::Decimal(7, 2));
+        let b = PrimitiveArray::from([Some(12345_678i128)]).to(DataType::Decimal(8, 3));
         let result = adaptive_mul(&a, &b).unwrap();
 
-        let expected =
-            PrimitiveArray::from(&vec![Some(152415666_514i128)]).to(DataType::Decimal(12, 3));
+        let expected = PrimitiveArray::from([Some(152415666_514i128)]).to(DataType::Decimal(12, 3));
 
         assert_eq!(result, expected);
         assert_eq!(result.data_type(), &DataType::Decimal(12, 3));
diff --git a/src/compute/arithmetics/decimal/sub.rs b/src/compute/arithmetics/decimal/sub.rs
index d7a4d97d1f..eba1f92bf9 100644
--- a/src/compute/arithmetics/decimal/sub.rs
+++ b/src/compute/arithmetics/decimal/sub.rs
@@ -42,11 +42,11 @@ use super::{adjusted_precision_scale, max_value, number_digits};
 /// use arrow2::array::PrimitiveArray;
 /// use arrow2::datatypes::DataType;
 ///
-/// let a = PrimitiveArray::from(&vec![Some(1i128), Some(1i128), None, Some(2i128)]).to(DataType::Decimal(5, 2));
-/// let b = PrimitiveArray::from(&vec![Some(1i128), Some(2i128), None, Some(2i128)]).to(DataType::Decimal(5, 2));
+/// let a = PrimitiveArray::from([Some(1i128), Some(1i128), None, Some(2i128)]).to(DataType::Decimal(5, 2));
+/// let b = PrimitiveArray::from([Some(1i128), Some(2i128), None, Some(2i128)]).to(DataType::Decimal(5, 2));
 ///
 /// let result = sub(&a, &b).unwrap();
-/// let expected = PrimitiveArray::from(&vec![Some(0i128), Some(-1i128), None, Some(0i128)]).to(DataType::Decimal(5, 2));
+/// let expected = PrimitiveArray::from([Some(0i128), Some(-1i128), None, Some(0i128)]).to(DataType::Decimal(5, 2));
 ///
 /// assert_eq!(result, expected);
 /// ```
@@ -95,11 +95,11 @@ pub fn sub(lhs: &PrimitiveArray<i128>, rhs: &PrimitiveArray<i128>) -> Result<Pri
 /// use arrow2::array::PrimitiveArray;
 /// use arrow2::datatypes::DataType;
 ///
-/// let a = PrimitiveArray::from(&vec![Some(-99000i128), Some(11100i128), None, Some(22200i128)]).to(DataType::Decimal(5, 2));
-/// let b = PrimitiveArray::from(&vec![Some(01000i128), Some(22200i128), None, Some(11100i128)]).to(DataType::Decimal(5, 2));
+/// let a = PrimitiveArray::from([Some(-99000i128), Some(11100i128), None, Some(22200i128)]).to(DataType::Decimal(5, 2));
+/// let b = PrimitiveArray::from([Some(01000i128), Some(22200i128), None, Some(11100i128)]).to(DataType::Decimal(5, 2));
 ///
 /// let result = saturating_sub(&a, &b).unwrap();
-/// let expected = PrimitiveArray::from(&vec![Some(-99999i128), Some(-11100i128), None, Some(11100i128)]).to(DataType::Decimal(5, 2));
+/// let expected = PrimitiveArray::from([Some(-99999i128), Some(-11100i128), None, Some(11100i128)]).to(DataType::Decimal(5, 2));
 ///
 /// assert_eq!(result, expected);
 /// ```
@@ -181,11 +181,11 @@ impl ArraySaturatingSub<PrimitiveArray<i128>> for PrimitiveArray<i128> {
 /// use arrow2::array::PrimitiveArray;
 /// use arrow2::datatypes::DataType;
 ///
-/// let a = PrimitiveArray::from(&vec![Some(-99000i128), Some(11100i128), None, Some(22200i128)]).to(DataType::Decimal(5, 2));
-/// let b = PrimitiveArray::from(&vec![Some(01000i128), Some(22200i128), None, Some(11100i128)]).to(DataType::Decimal(5, 2));
+/// let a = PrimitiveArray::from([Some(-99000i128), Some(11100i128), None, Some(22200i128)]).to(DataType::Decimal(5, 2));
+/// let b = PrimitiveArray::from([Some(01000i128), Some(22200i128), None, Some(11100i128)]).to(DataType::Decimal(5, 2));
 ///
 /// let result = checked_sub(&a, &b).unwrap();
-/// let expected = PrimitiveArray::from(&vec![None, Some(-11100i128), None, Some(11100i128)]).to(DataType::Decimal(5, 2));
+/// let expected = PrimitiveArray::from([None, Some(-11100i128), None, Some(11100i128)]).to(DataType::Decimal(5, 2));
 ///
 /// assert_eq!(result, expected);
 /// ```
@@ -240,10 +240,10 @@ pub fn checked_sub(
 /// use arrow2::array::PrimitiveArray;
 /// use arrow2::datatypes::DataType;
 ///
-/// let a = PrimitiveArray::from(&vec![Some(99_9999i128)]).to(DataType::Decimal(6, 4));
-/// let b = PrimitiveArray::from(&vec![Some(-00_0001i128)]).to(DataType::Decimal(6, 4));
+/// let a = PrimitiveArray::from([Some(99_9999i128)]).to(DataType::Decimal(6, 4));
+/// let b = PrimitiveArray::from([Some(-00_0001i128)]).to(DataType::Decimal(6, 4));
 /// let result = adaptive_sub(&a, &b).unwrap();
-/// let expected = PrimitiveArray::from(&vec![Some(100_0000i128)]).to(DataType::Decimal(7, 4));
+/// let expected = PrimitiveArray::from([Some(100_0000i128)]).to(DataType::Decimal(7, 4));
 ///
 /// assert_eq!(result, expected);
 /// ```
@@ -314,7 +314,7 @@ mod tests {
 
     #[test]
     fn test_subtract_normal() {
-        let a = PrimitiveArray::from(&vec![
+        let a = PrimitiveArray::from([
             Some(11111i128),
             Some(22200i128),
             None,
@@ -322,7 +322,7 @@ mod tests {
         ])
         .to(DataType::Decimal(5, 2));
 
-        let b = PrimitiveArray::from(&vec![
+        let b = PrimitiveArray::from([
             Some(22222i128),
             Some(11100i128),
             None,
@@ -331,7 +331,7 @@ mod tests {
         .to(DataType::Decimal(5, 2));
 
         let result = sub(&a, &b).unwrap();
-        let expected = PrimitiveArray::from(&vec![
+        let expected = PrimitiveArray::from([
             Some(-11111i128),
             Some(11100i128),
             None,
@@ -348,8 +348,8 @@ mod tests {
 
     #[test]
     fn test_subtract_decimal_wrong_precision() {
-        let a = PrimitiveArray::from(&vec![None]).to(DataType::Decimal(5, 2));
-        let b = PrimitiveArray::from(&vec![None]).to(DataType::Decimal(6, 2));
+        let a = PrimitiveArray::from([None]).to(DataType::Decimal(5, 2));
+        let b = PrimitiveArray::from([None]).to(DataType::Decimal(6, 2));
         let result = sub(&a, &b);
 
         if result.is_ok() {
@@ -360,14 +360,14 @@ mod tests {
     #[test]
     #[should_panic(expected = "Overflow in subtract presented for precision 5")]
     fn test_subtract_panic() {
-        let a = PrimitiveArray::from(&vec![Some(-99999i128)]).to(DataType::Decimal(5, 2));
-        let b = PrimitiveArray::from(&vec![Some(1i128)]).to(DataType::Decimal(5, 2));
+        let a = PrimitiveArray::from([Some(-99999i128)]).to(DataType::Decimal(5, 2));
+        let b = PrimitiveArray::from([Some(1i128)]).to(DataType::Decimal(5, 2));
         let _ = sub(&a, &b);
     }
 
     #[test]
     fn test_subtract_saturating() {
-        let a = PrimitiveArray::from(&vec![
+        let a = PrimitiveArray::from([
             Some(11111i128),
             Some(22200i128),
             None,
@@ -375,7 +375,7 @@ mod tests {
         ])
         .to(DataType::Decimal(5, 2));
 
-        let b = PrimitiveArray::from(&vec![
+        let b = PrimitiveArray::from([
             Some(22222i128),
             Some(11100i128),
             None,
@@ -384,7 +384,7 @@ mod tests {
         .to(DataType::Decimal(5, 2));
 
         let result = saturating_sub(&a, &b).unwrap();
-        let expected = PrimitiveArray::from(&vec![
+        let expected = PrimitiveArray::from([
             Some(-11111i128),
             Some(11100i128),
             None,
@@ -401,14 +401,14 @@ mod tests {
 
     #[test]
     fn test_subtract_saturating_overflow() {
-        let a = PrimitiveArray::from(&vec![
+        let a = PrimitiveArray::from([
             Some(-99999i128),
             Some(-99999i128),
             Some(-99999i128),
             Some(99999i128),
         ])
         .to(DataType::Decimal(5, 2));
-        let b = PrimitiveArray::from(&vec![
+        let b = PrimitiveArray::from([
             Some(00001i128),
             Some(00100i128),
             Some(10000i128),
@@ -418,7 +418,7 @@ mod tests {
 
         let result = saturating_sub(&a, &b).unwrap();
 
-        let expected = PrimitiveArray::from(&vec![
+        let expected = PrimitiveArray::from([
             Some(-99999i128),
             Some(-99999i128),
             Some(-99999i128),
@@ -435,7 +435,7 @@ mod tests {
 
     #[test]
     fn test_subtract_checked() {
-        let a = PrimitiveArray::from(&vec![
+        let a = PrimitiveArray::from([
             Some(11111i128),
             Some(22200i128),
             None,
@@ -443,7 +443,7 @@ mod tests {
         ])
         .to(DataType::Decimal(5, 2));
 
-        let b = PrimitiveArray::from(&vec![
+        let b = PrimitiveArray::from([
             Some(22222i128),
             Some(11100i128),
             None,
@@ -452,7 +452,7 @@ mod tests {
         .to(DataType::Decimal(5, 2));
 
         let result = checked_sub(&a, &b).unwrap();
-        let expected = PrimitiveArray::from(&vec![
+        let expected = PrimitiveArray::from([
             Some(-11111i128),
             Some(11100i128),
             None,
@@ -470,10 +470,10 @@ mod tests {
     #[test]
     fn test_subtract_checked_overflow() {
         let a =
-            PrimitiveArray::from(&vec![Some(4i128), Some(-99999i128)]).to(DataType::Decimal(5, 2));
-        let b = PrimitiveArray::from(&vec![Some(2i128), Some(1i128)]).to(DataType::Decimal(5, 2));
+            PrimitiveArray::from([Some(4i128), Some(-99999i128)]).to(DataType::Decimal(5, 2));
+        let b = PrimitiveArray::from([Some(2i128), Some(1i128)]).to(DataType::Decimal(5, 2));
         let result = checked_sub(&a, &b).unwrap();
-        let expected = PrimitiveArray::from(&vec![Some(2i128), None]).to(DataType::Decimal(5, 2));
+        let expected = PrimitiveArray::from([Some(2i128), None]).to(DataType::Decimal(5, 2));
         assert_eq!(result, expected);
     }
 
@@ -483,12 +483,12 @@ mod tests {
         //  11111.11   -> 7, 2
         // ------------------
         // -11099.9989 -> 9, 4
-        let a = PrimitiveArray::from(&vec![Some(11_1111i128)]).to(DataType::Decimal(6, 4));
-        let b = PrimitiveArray::from(&vec![Some(11111_11i128)]).to(DataType::Decimal(7, 2));
+        let a = PrimitiveArray::from([Some(11_1111i128)]).to(DataType::Decimal(6, 4));
+        let b = PrimitiveArray::from([Some(11111_11i128)]).to(DataType::Decimal(7, 2));
         let result = adaptive_sub(&a, &b).unwrap();
 
         let expected =
-            PrimitiveArray::from(&vec![Some(-11099_9989i128)]).to(DataType::Decimal(9, 4));
+            PrimitiveArray::from([Some(-11099_9989i128)]).to(DataType::Decimal(9, 4));
 
         assert_eq!(result, expected);
         assert_eq!(result.data_type(), &DataType::Decimal(9, 4));
@@ -497,12 +497,12 @@ mod tests {
         //     0.1111 -> 5, 4
         // -----------------
         // 11110.8889 -> 9, 4
-        let a = PrimitiveArray::from(&vec![Some(11111_0i128)]).to(DataType::Decimal(6, 1));
-        let b = PrimitiveArray::from(&vec![Some(1111i128)]).to(DataType::Decimal(5, 4));
+        let a = PrimitiveArray::from([Some(11111_0i128)]).to(DataType::Decimal(6, 1));
+        let b = PrimitiveArray::from([Some(1111i128)]).to(DataType::Decimal(5, 4));
         let result = adaptive_sub(&a, &b).unwrap();
 
         let expected =
-            PrimitiveArray::from(&vec![Some(11110_8889i128)]).to(DataType::Decimal(9, 4));
+            PrimitiveArray::from([Some(11110_8889i128)]).to(DataType::Decimal(9, 4));
 
         assert_eq!(result, expected);
         assert_eq!(result.data_type(), &DataType::Decimal(9, 4));
@@ -511,12 +511,12 @@ mod tests {
         //  11111.111  -> 8, 3
         // -----------------
         // -00000.001  -> 8, 3
-        let a = PrimitiveArray::from(&vec![Some(11111_11i128)]).to(DataType::Decimal(7, 2));
-        let b = PrimitiveArray::from(&vec![Some(11111_111i128)]).to(DataType::Decimal(8, 3));
+        let a = PrimitiveArray::from([Some(11111_11i128)]).to(DataType::Decimal(7, 2));
+        let b = PrimitiveArray::from([Some(11111_111i128)]).to(DataType::Decimal(8, 3));
         let result = adaptive_sub(&a, &b).unwrap();
 
         let expected =
-            PrimitiveArray::from(&vec![Some(-00000_001i128)]).to(DataType::Decimal(8, 3));
+            PrimitiveArray::from([Some(-00000_001i128)]).to(DataType::Decimal(8, 3));
 
         assert_eq!(result, expected);
         assert_eq!(result.data_type(), &DataType::Decimal(8, 3));
@@ -525,11 +525,11 @@ mod tests {
         // -00.0001 -> 6, 4
         // -----------------
         // 100.0000 -> 7, 4
-        let a = PrimitiveArray::from(&vec![Some(99_9999i128)]).to(DataType::Decimal(6, 4));
-        let b = PrimitiveArray::from(&vec![Some(-00_0001i128)]).to(DataType::Decimal(6, 4));
+        let a = PrimitiveArray::from([Some(99_9999i128)]).to(DataType::Decimal(6, 4));
+        let b = PrimitiveArray::from([Some(-00_0001i128)]).to(DataType::Decimal(6, 4));
         let result = adaptive_sub(&a, &b).unwrap();
 
-        let expected = PrimitiveArray::from(&vec![Some(100_0000i128)]).to(DataType::Decimal(7, 4));
+        let expected = PrimitiveArray::from([Some(100_0000i128)]).to(DataType::Decimal(7, 4));
 
         assert_eq!(result, expected);
         assert_eq!(result.data_type(), &DataType::Decimal(7, 4));
diff --git a/src/compute/arithmetics/mod.rs b/src/compute/arithmetics/mod.rs
index ad7eb846c8..c22ff7428d 100644
--- a/src/compute/arithmetics/mod.rs
+++ b/src/compute/arithmetics/mod.rs
@@ -283,11 +283,10 @@ where
 /// ```
 /// use arrow2::compute::arithmetics::negate;
 /// use arrow2::array::PrimitiveArray;
-/// use arrow2::datatypes::DataType;
 ///
-/// let a = PrimitiveArray::from(&vec![None, Some(6), None, Some(7)]).to(DataType::Int32);
+/// let a = PrimitiveArray::from([None, Some(6), None, Some(7)]);
 /// let result = negate(&a);
-/// let expected = PrimitiveArray::from(&vec![None, Some(-6), None, Some(-7)]).to(DataType::Int32);
+/// let expected = PrimitiveArray::from([None, Some(-6), None, Some(-7)]);
 /// assert_eq!(result, expected)
 /// ```
 pub fn negate<T>(array: &PrimitiveArray<T>) -> PrimitiveArray<T>
diff --git a/src/compute/arithmetics/time.rs b/src/compute/arithmetics/time.rs
index 509fbc4a38..cc6a0579c8 100644
--- a/src/compute/arithmetics/time.rs
+++ b/src/compute/arithmetics/time.rs
@@ -71,7 +71,7 @@ fn create_scale(lhs: &DataType, rhs: &DataType) -> Result<f64> {
 /// use arrow2::array::PrimitiveArray;
 /// use arrow2::datatypes::{DataType, TimeUnit};
 ///
-/// let timestamp = PrimitiveArray::from(&vec![
+/// let timestamp = PrimitiveArray::from([
 ///     Some(100000i64),
 ///     Some(200000i64),
 ///     None,
@@ -82,11 +82,11 @@ fn create_scale(lhs: &DataType, rhs: &DataType) -> Result<f64> {
 ///     Some("America/New_York".to_string()),
 /// ));
 ///
-/// let duration = PrimitiveArray::from(&vec![Some(10i64), Some(20i64), None, Some(30i64)])
+/// let duration = PrimitiveArray::from([Some(10i64), Some(20i64), None, Some(30i64)])
 ///     .to(DataType::Duration(TimeUnit::Second));
 ///
 /// let result = add_duration(&timestamp, &duration).unwrap();
-/// let expected = PrimitiveArray::from(&vec![
+/// let expected = PrimitiveArray::from([
 ///     Some(100010i64),
 ///     Some(200020i64),
 ///     None,
@@ -126,7 +126,7 @@ where
 /// use arrow2::array::PrimitiveArray;
 /// use arrow2::datatypes::{DataType, TimeUnit};
 ///
-/// let timestamp = PrimitiveArray::from(&vec![
+/// let timestamp = PrimitiveArray::from([
 ///     Some(100000i64),
 ///     Some(200000i64),
 ///     None,
@@ -137,11 +137,11 @@ where
 ///     Some("America/New_York".to_string()),
 /// ));
 ///
-/// let duration = PrimitiveArray::from(&vec![Some(10i64), Some(20i64), None, Some(30i64)])
+/// let duration = PrimitiveArray::from([Some(10i64), Some(20i64), None, Some(30i64)])
 ///     .to(DataType::Duration(TimeUnit::Second));
 ///
 /// let result = subtract_duration(&timestamp, &duration).unwrap();
-/// let expected = PrimitiveArray::from(&vec![
+/// let expected = PrimitiveArray::from([
 ///     Some(99990i64),
 ///     Some(199980i64),
 ///     None,
@@ -181,7 +181,7 @@ where
 /// use arrow2::compute::arithmetics::time::subtract_timestamps;
 /// use arrow2::array::PrimitiveArray;
 /// use arrow2::datatypes::{DataType, TimeUnit};
-/// let timestamp_a = PrimitiveArray::from(&vec![
+/// let timestamp_a = PrimitiveArray::from([
 ///     Some(100_010i64),
 ///     Some(200_020i64),
 ///     None,
@@ -189,7 +189,7 @@ where
 /// ])
 /// .to(DataType::Timestamp(TimeUnit::Second, None));
 ///
-/// let timestamp_b = PrimitiveArray::from(&vec![
+/// let timestamp_b = PrimitiveArray::from([
 ///     Some(100_000i64),
 ///     Some(200_000i64),
 ///     None,
@@ -197,7 +197,7 @@ where
 /// ])
 /// .to(DataType::Timestamp(TimeUnit::Second, None));
 ///
-/// let expected = PrimitiveArray::from(&vec![Some(10i64), Some(20i64), None, Some(30i64)])
+/// let expected = PrimitiveArray::from([Some(10i64), Some(20i64), None, Some(30i64)])
 ///     .to(DataType::Duration(TimeUnit::Second));
 ///
 /// let result = subtract_timestamps(&timestamp_a, &&timestamp_b).unwrap();
@@ -235,66 +235,38 @@ mod tests {
 
     #[test]
     fn test_adding_timestamp() {
-        let timestamp = PrimitiveArray::from(&vec![
-            Some(100000i64),
-            Some(200000i64),
-            None,
-            Some(300000i64),
-        ])
-        .to(DataType::Timestamp(
-            TimeUnit::Second,
-            Some("America/New_York".to_string()),
-        ));
+        let timestamp =
+            PrimitiveArray::from([Some(100000i64), Some(200000i64), None, Some(300000i64)]).to(
+                DataType::Timestamp(TimeUnit::Second, Some("America/New_York".to_string())),
+            );
 
-        let duration = PrimitiveArray::from(&vec![Some(10i64), Some(20i64), None, Some(30i64)])
+        let duration = PrimitiveArray::from([Some(10i64), Some(20i64), None, Some(30i64)])
             .to(DataType::Duration(TimeUnit::Second));
 
         let result = add_duration(&timestamp, &duration).unwrap();
-        let expected = PrimitiveArray::from(&vec![
-            Some(100010i64),
-            Some(200020i64),
-            None,
-            Some(300030i64),
-        ])
-        .to(DataType::Timestamp(
-            TimeUnit::Second,
-            Some("America/New_York".to_string()),
-        ));
+        let expected =
+            PrimitiveArray::from([Some(100010i64), Some(200020i64), None, Some(300030i64)]).to(
+                DataType::Timestamp(TimeUnit::Second, Some("America/New_York".to_string())),
+            );
 
         assert_eq!(result, expected);
     }
 
     #[test]
     fn test_adding_duration_different_scale() {
-        let timestamp = PrimitiveArray::from(&vec![
-            Some(100000i64),
-            Some(200000i64),
-            None,
-            Some(300000i64),
-        ])
-        .to(DataType::Timestamp(
-            TimeUnit::Second,
-            Some("America/New_York".to_string()),
-        ));
-        let expected = PrimitiveArray::from(&vec![
-            Some(100010i64),
-            Some(200020i64),
-            None,
-            Some(300030i64),
-        ])
-        .to(DataType::Timestamp(
-            TimeUnit::Second,
-            Some("America/New_York".to_string()),
-        ));
+        let timestamp =
+            PrimitiveArray::from([Some(100000i64), Some(200000i64), None, Some(300000i64)]).to(
+                DataType::Timestamp(TimeUnit::Second, Some("America/New_York".to_string())),
+            );
+        let expected =
+            PrimitiveArray::from([Some(100010i64), Some(200020i64), None, Some(300030i64)]).to(
+                DataType::Timestamp(TimeUnit::Second, Some("America/New_York".to_string())),
+            );
 
         // Testing duration in milliseconds
-        let duration = PrimitiveArray::from(&vec![
-            Some(10_000i64),
-            Some(20_000i64),
-            None,
-            Some(30_000i64),
-        ])
-        .to(DataType::Duration(TimeUnit::Millisecond));
+        let duration =
+            PrimitiveArray::from([Some(10_000i64), Some(20_000i64), None, Some(30_000i64)])
+                .to(DataType::Duration(TimeUnit::Millisecond));
 
         let result = add_duration(&timestamp, &duration).unwrap();
         assert_eq!(result, expected);
@@ -303,7 +275,7 @@ mod tests {
         // The last digits in the nanosecond are not significant enough to
         // be added to the timestamp which is in seconds and doesn't have a
         // fractional value
-        let duration = PrimitiveArray::from(&vec![
+        let duration = PrimitiveArray::from([
             Some(10_000_000_999i64),
             Some(20_000_000_000i64),
             None,
@@ -317,29 +289,27 @@ mod tests {
 
     #[test]
     fn test_adding_subtract_timestamps_scale() {
-        let timestamp =
-            PrimitiveArray::from(&vec![Some(10i64), Some(20i64), None, Some(30i64)]).to(
-                DataType::Timestamp(TimeUnit::Millisecond, Some("America/New_York".to_string())),
-            );
-        let duration = PrimitiveArray::from(&vec![Some(1i64), Some(2i64), None, Some(3i64)])
+        let timestamp = PrimitiveArray::from([Some(10i64), Some(20i64), None, Some(30i64)]).to(
+            DataType::Timestamp(TimeUnit::Millisecond, Some("America/New_York".to_string())),
+        );
+        let duration = PrimitiveArray::from([Some(1i64), Some(2i64), None, Some(3i64)])
             .to(DataType::Duration(TimeUnit::Second));
 
         let expected =
-            PrimitiveArray::from(&vec![Some(1_010i64), Some(2_020i64), None, Some(3_030i64)]).to(
+            PrimitiveArray::from([Some(1_010i64), Some(2_020i64), None, Some(3_030i64)]).to(
                 DataType::Timestamp(TimeUnit::Millisecond, Some("America/New_York".to_string())),
             );
 
         let result = add_duration(&timestamp, &duration).unwrap();
         assert_eq!(result, expected);
 
-        let timestamp =
-            PrimitiveArray::from(&vec![Some(10i64), Some(20i64), None, Some(30i64)]).to(
-                DataType::Timestamp(TimeUnit::Nanosecond, Some("America/New_York".to_string())),
-            );
-        let duration = PrimitiveArray::from(&vec![Some(1i64), Some(2i64), None, Some(3i64)])
+        let timestamp = PrimitiveArray::from([Some(10i64), Some(20i64), None, Some(30i64)]).to(
+            DataType::Timestamp(TimeUnit::Nanosecond, Some("America/New_York".to_string())),
+        );
+        let duration = PrimitiveArray::from([Some(1i64), Some(2i64), None, Some(3i64)])
             .to(DataType::Duration(TimeUnit::Second));
 
-        let expected = PrimitiveArray::from(&vec![
+        let expected = PrimitiveArray::from([
             Some(1_000_000_010i64),
             Some(2_000_000_020i64),
             None,
@@ -356,66 +326,38 @@ mod tests {
 
     #[test]
     fn test_subtract_timestamp() {
-        let timestamp = PrimitiveArray::from(&vec![
-            Some(100000i64),
-            Some(200000i64),
-            None,
-            Some(300000i64),
-        ])
-        .to(DataType::Timestamp(
-            TimeUnit::Second,
-            Some("America/New_York".to_string()),
-        ));
+        let timestamp =
+            PrimitiveArray::from([Some(100000i64), Some(200000i64), None, Some(300000i64)]).to(
+                DataType::Timestamp(TimeUnit::Second, Some("America/New_York".to_string())),
+            );
 
-        let duration = PrimitiveArray::from(&vec![Some(10i64), Some(20i64), None, Some(30i64)])
+        let duration = PrimitiveArray::from([Some(10i64), Some(20i64), None, Some(30i64)])
             .to(DataType::Duration(TimeUnit::Second));
 
         let result = subtract_duration(&timestamp, &duration).unwrap();
-        let expected = PrimitiveArray::from(&vec![
-            Some(99990i64),
-            Some(199980i64),
-            None,
-            Some(299970i64),
-        ])
-        .to(DataType::Timestamp(
-            TimeUnit::Second,
-            Some("America/New_York".to_string()),
-        ));
+        let expected =
+            PrimitiveArray::from([Some(99990i64), Some(199980i64), None, Some(299970i64)]).to(
+                DataType::Timestamp(TimeUnit::Second, Some("America/New_York".to_string())),
+            );
 
         assert_eq!(result, expected);
     }
 
     #[test]
     fn test_subtracting_duration_different_scale() {
-        let timestamp = PrimitiveArray::from(&vec![
-            Some(100000i64),
-            Some(200000i64),
-            None,
-            Some(300000i64),
-        ])
-        .to(DataType::Timestamp(
-            TimeUnit::Second,
-            Some("America/New_York".to_string()),
-        ));
-        let expected = PrimitiveArray::from(&vec![
-            Some(99990i64),
-            Some(199980i64),
-            None,
-            Some(299970i64),
-        ])
-        .to(DataType::Timestamp(
-            TimeUnit::Second,
-            Some("America/New_York".to_string()),
-        ));
+        let timestamp =
+            PrimitiveArray::from([Some(100000i64), Some(200000i64), None, Some(300000i64)]).to(
+                DataType::Timestamp(TimeUnit::Second, Some("America/New_York".to_string())),
+            );
+        let expected =
+            PrimitiveArray::from([Some(99990i64), Some(199980i64), None, Some(299970i64)]).to(
+                DataType::Timestamp(TimeUnit::Second, Some("America/New_York".to_string())),
+            );
 
         // Testing duration in milliseconds
-        let duration = PrimitiveArray::from(&vec![
-            Some(10_000i64),
-            Some(20_000i64),
-            None,
-            Some(30_000i64),
-        ])
-        .to(DataType::Duration(TimeUnit::Millisecond));
+        let duration =
+            PrimitiveArray::from([Some(10_000i64), Some(20_000i64), None, Some(30_000i64)])
+                .to(DataType::Duration(TimeUnit::Millisecond));
 
         let result = subtract_duration(&timestamp, &duration).unwrap();
         assert_eq!(result, expected);
@@ -424,7 +366,7 @@ mod tests {
         // The last digits in the nanosecond are not significant enough to
         // be added to the timestamp which is in seconds and doesn't have a
         // fractional value
-        let duration = PrimitiveArray::from(&vec![
+        let duration = PrimitiveArray::from([
             Some(10_000_000_999i64),
             Some(20_000_000_000i64),
             None,
@@ -438,29 +380,27 @@ mod tests {
 
     #[test]
     fn test_subtracting_subtract_timestamps_scale() {
-        let timestamp =
-            PrimitiveArray::from(&vec![Some(10i64), Some(20i64), None, Some(30i64)]).to(
-                DataType::Timestamp(TimeUnit::Millisecond, Some("America/New_York".to_string())),
-            );
-        let duration = PrimitiveArray::from(&vec![Some(1i64), Some(2i64), None, Some(3i64)])
+        let timestamp = PrimitiveArray::from([Some(10i64), Some(20i64), None, Some(30i64)]).to(
+            DataType::Timestamp(TimeUnit::Millisecond, Some("America/New_York".to_string())),
+        );
+        let duration = PrimitiveArray::from([Some(1i64), Some(2i64), None, Some(3i64)])
             .to(DataType::Duration(TimeUnit::Second));
 
         let expected =
-            PrimitiveArray::from(&vec![Some(-990i64), Some(-1_980i64), None, Some(-2_970i64)]).to(
+            PrimitiveArray::from([Some(-990i64), Some(-1_980i64), None, Some(-2_970i64)]).to(
                 DataType::Timestamp(TimeUnit::Millisecond, Some("America/New_York".to_string())),
             );
 
         let result = subtract_duration(&timestamp, &duration).unwrap();
         assert_eq!(result, expected);
 
-        let timestamp =
-            PrimitiveArray::from(&vec![Some(10i64), Some(20i64), None, Some(30i64)]).to(
-                DataType::Timestamp(TimeUnit::Nanosecond, Some("America/New_York".to_string())),
-            );
-        let duration = PrimitiveArray::from(&vec![Some(1i64), Some(2i64), None, Some(3i64)])
+        let timestamp = PrimitiveArray::from([Some(10i64), Some(20i64), None, Some(30i64)]).to(
+            DataType::Timestamp(TimeUnit::Nanosecond, Some("America/New_York".to_string())),
+        );
+        let duration = PrimitiveArray::from([Some(1i64), Some(2i64), None, Some(3i64)])
             .to(DataType::Duration(TimeUnit::Second));
 
-        let expected = PrimitiveArray::from(&vec![
+        let expected = PrimitiveArray::from([
             Some(-999_999_990i64),
             Some(-1_999_999_980i64),
             None,
@@ -477,23 +417,15 @@ mod tests {
 
     #[test]
     fn test_subtract_timestamps() {
-        let timestamp_a = PrimitiveArray::from(&vec![
-            Some(100_010i64),
-            Some(200_020i64),
-            None,
-            Some(300_030i64),
-        ])
-        .to(DataType::Timestamp(TimeUnit::Second, None));
+        let timestamp_a =
+            PrimitiveArray::from([Some(100_010i64), Some(200_020i64), None, Some(300_030i64)])
+                .to(DataType::Timestamp(TimeUnit::Second, None));
 
-        let timestamp_b = PrimitiveArray::from(&vec![
-            Some(100_000i64),
-            Some(200_000i64),
-            None,
-            Some(300_000i64),
-        ])
-        .to(DataType::Timestamp(TimeUnit::Second, None));
+        let timestamp_b =
+            PrimitiveArray::from([Some(100_000i64), Some(200_000i64), None, Some(300_000i64)])
+                .to(DataType::Timestamp(TimeUnit::Second, None));
 
-        let expected = PrimitiveArray::from(&vec![Some(10i64), Some(20i64), None, Some(30i64)])
+        let expected = PrimitiveArray::from([Some(10i64), Some(20i64), None, Some(30i64)])
             .to(DataType::Duration(TimeUnit::Second));
 
         let result = subtract_timestamps(&timestamp_a, &timestamp_b).unwrap();
@@ -502,7 +434,7 @@ mod tests {
 
     #[test]
     fn test_subtract_timestamps_scale() {
-        let timestamp_a = PrimitiveArray::from(&vec![
+        let timestamp_a = PrimitiveArray::from([
             Some(100_000_000i64),
             Some(200_000_000i64),
             None,
@@ -510,21 +442,13 @@ mod tests {
         ])
         .to(DataType::Timestamp(TimeUnit::Millisecond, None));
 
-        let timestamp_b = PrimitiveArray::from(&vec![
-            Some(100_010i64),
-            Some(200_020i64),
-            None,
-            Some(300_030i64),
-        ])
-        .to(DataType::Timestamp(TimeUnit::Second, None));
+        let timestamp_b =
+            PrimitiveArray::from([Some(100_010i64), Some(200_020i64), None, Some(300_030i64)])
+                .to(DataType::Timestamp(TimeUnit::Second, None));
 
-        let expected = PrimitiveArray::from(&vec![
-            Some(-10_000i64),
-            Some(-20_000i64),
-            None,
-            Some(-30_000i64),
-        ])
-        .to(DataType::Duration(TimeUnit::Millisecond));
+        let expected =
+            PrimitiveArray::from([Some(-10_000i64), Some(-20_000i64), None, Some(-30_000i64)])
+                .to(DataType::Duration(TimeUnit::Millisecond));
 
         let result = subtract_timestamps(&timestamp_a, &timestamp_b).unwrap();
         assert_eq!(result, expected);
@@ -532,59 +456,43 @@ mod tests {
 
     #[test]
     fn test_adding_to_time() {
-        let duration = PrimitiveArray::from(&vec![Some(10i64), Some(20i64), None, Some(30i64)])
+        let duration = PrimitiveArray::from([Some(10i64), Some(20i64), None, Some(30i64)])
             .to(DataType::Duration(TimeUnit::Second));
 
         // Testing Time32
-        let time_32 = PrimitiveArray::from(&vec![
-            Some(100000i32),
-            Some(200000i32),
-            None,
-            Some(300000i32),
-        ])
-        .to(DataType::Time32(TimeUnit::Second));
+        let time_32 =
+            PrimitiveArray::from([Some(100000i32), Some(200000i32), None, Some(300000i32)])
+                .to(DataType::Time32(TimeUnit::Second));
 
         let result = add_duration(&time_32, &duration).unwrap();
-        let expected = PrimitiveArray::from(&vec![
-            Some(100010i32),
-            Some(200020i32),
-            None,
-            Some(300030i32),
-        ])
-        .to(DataType::Time32(TimeUnit::Second));
+        let expected =
+            PrimitiveArray::from([Some(100010i32), Some(200020i32), None, Some(300030i32)])
+                .to(DataType::Time32(TimeUnit::Second));
 
         assert_eq!(result, expected);
     }
 
     #[test]
     fn test_subtract_to_time() {
-        let duration = PrimitiveArray::from(&vec![Some(10i64), Some(20i64), None, Some(30i64)])
+        let duration = PrimitiveArray::from([Some(10i64), Some(20i64), None, Some(30i64)])
             .to(DataType::Duration(TimeUnit::Second));
 
         // Testing Time32
-        let time_32 = PrimitiveArray::from(&vec![
-            Some(100000i32),
-            Some(200000i32),
-            None,
-            Some(300000i32),
-        ])
-        .to(DataType::Time32(TimeUnit::Second));
+        let time_32 =
+            PrimitiveArray::from([Some(100000i32), Some(200000i32), None, Some(300000i32)])
+                .to(DataType::Time32(TimeUnit::Second));
 
         let result = subtract_duration(&time_32, &duration).unwrap();
-        let expected = PrimitiveArray::from(&vec![
-            Some(99990i32),
-            Some(199980i32),
-            None,
-            Some(299970i32),
-        ])
-        .to(DataType::Time32(TimeUnit::Second));
+        let expected =
+            PrimitiveArray::from([Some(99990i32), Some(199980i32), None, Some(299970i32)])
+                .to(DataType::Time32(TimeUnit::Second));
 
         assert_eq!(result, expected);
     }
 
     #[test]
     fn test_date32() {
-        let duration = PrimitiveArray::from(&vec![
+        let duration = PrimitiveArray::from([
             Some(86_400),     // 1 day
             Some(864_000i64), // 10 days
             None,
@@ -592,40 +500,28 @@ mod tests {
         ])
         .to(DataType::Duration(TimeUnit::Second));
 
-        let date_32 = PrimitiveArray::from(&vec![
-            Some(100_000i32),
-            Some(100_000i32),
-            None,
-            Some(100_000i32),
-        ])
-        .to(DataType::Date32);
+        let date_32 =
+            PrimitiveArray::from([Some(100_000i32), Some(100_000i32), None, Some(100_000i32)])
+                .to(DataType::Date32);
 
         let result = add_duration(&date_32, &duration).unwrap();
-        let expected = PrimitiveArray::from(&vec![
-            Some(100_001i32),
-            Some(100_010i32),
-            None,
-            Some(100_100i32),
-        ])
-        .to(DataType::Date32);
+        let expected =
+            PrimitiveArray::from([Some(100_001i32), Some(100_010i32), None, Some(100_100i32)])
+                .to(DataType::Date32);
 
         assert_eq!(result, expected);
 
         let result = subtract_duration(&date_32, &duration).unwrap();
-        let expected = PrimitiveArray::from(&vec![
-            Some(99_999i32),
-            Some(99_990i32),
-            None,
-            Some(99_900i32),
-        ])
-        .to(DataType::Date32);
+        let expected =
+            PrimitiveArray::from([Some(99_999i32), Some(99_990i32), None, Some(99_900i32)])
+                .to(DataType::Date32);
 
         assert_eq!(result, expected);
     }
 
     #[test]
     fn test_date64() {
-        let duration = PrimitiveArray::from(&vec![
+        let duration = PrimitiveArray::from([
             Some(10i64),  // 10 milliseconds
             Some(100i64), // 100 milliseconds
             None,
@@ -633,33 +529,21 @@ mod tests {
         ])
         .to(DataType::Duration(TimeUnit::Millisecond));
 
-        let date_64 = PrimitiveArray::from(&vec![
-            Some(100_000i64),
-            Some(100_000i64),
-            None,
-            Some(100_000i64),
-        ])
-        .to(DataType::Date64);
+        let date_64 =
+            PrimitiveArray::from([Some(100_000i64), Some(100_000i64), None, Some(100_000i64)])
+                .to(DataType::Date64);
 
         let result = add_duration(&date_64, &duration).unwrap();
-        let expected = PrimitiveArray::from(&vec![
-            Some(100_010i64),
-            Some(100_100i64),
-            None,
-            Some(101_000i64),
-        ])
-        .to(DataType::Date64);
+        let expected =
+            PrimitiveArray::from([Some(100_010i64), Some(100_100i64), None, Some(101_000i64)])
+                .to(DataType::Date64);
 
         assert_eq!(result, expected);
 
         let result = subtract_duration(&date_64, &duration).unwrap();
-        let expected = PrimitiveArray::from(&vec![
-            Some(99_990i64),
-            Some(99_900i64),
-            None,
-            Some(99_000i64),
-        ])
-        .to(DataType::Date64);
+        let expected =
+            PrimitiveArray::from([Some(99_990i64), Some(99_900i64), None, Some(99_000i64)])
+                .to(DataType::Date64);
 
         assert_eq!(result, expected);
     }
diff --git a/src/compute/filter.rs b/src/compute/filter.rs
index 62421afb6a..f7132cc472 100644
--- a/src/compute/filter.rs
+++ b/src/compute/filter.rs
@@ -173,15 +173,14 @@ pub fn build_filter(filter: &BooleanArray) -> Result<Filter> {
 /// # Example
 /// ```rust
 /// # use arrow2::array::{Int32Array, PrimitiveArray, BooleanArray};
-/// # use arrow2::datatypes::DataType;
 /// # use arrow2::error::Result;
 /// # use arrow2::compute::filter::filter;
 /// # fn main() -> Result<()> {
-/// let array = PrimitiveArray::from_slice(&vec![5, 6, 7, 8, 9]).to(DataType::Int32);
+/// let array = PrimitiveArray::from_slice([5, 6, 7, 8, 9]);
 /// let filter_array = BooleanArray::from_slice(&vec![true, false, false, true, false]);
 /// let c = filter(&array, &filter_array)?;
 /// let c = c.as_any().downcast_ref::<Int32Array>().unwrap();
-/// assert_eq!(c, &PrimitiveArray::from_slice(vec![5, 8]).to(DataType::Int32));
+/// assert_eq!(c, &PrimitiveArray::from_slice(vec![5, 8]));
 /// # Ok(())
 /// # }
 /// ```
diff --git a/src/compute/take/list.rs b/src/compute/take/list.rs
index 5f2fbf4c28..0b219a2888 100644
--- a/src/compute/take/list.rs
+++ b/src/compute/take/list.rs
@@ -87,7 +87,7 @@ mod tests {
             None,
         );
 
-        let indices = PrimitiveArray::from(&vec![Some(4i32), Some(1), Some(3)]).to(DataType::Int32);
+        let indices = PrimitiveArray::from([Some(4i32), Some(1), Some(3)]);
         let result = take(&array, &indices);
 
         let expected_values = Buffer::from([9, 6, 7, 8]);
@@ -120,8 +120,7 @@ mod tests {
             Some(validity),
         );
 
-        let indices =
-            PrimitiveArray::from(&vec![Some(4i32), None, Some(2), Some(3)]).to(DataType::Int32);
+        let indices = PrimitiveArray::from([Some(4i32), None, Some(2), Some(3)]);
         let result = take(&array, &indices);
 
         let data_expected = vec![
@@ -151,8 +150,7 @@ mod tests {
         array.try_extend(values).unwrap();
         let array: ListArray<i32> = array.into();
 
-        let indices =
-            PrimitiveArray::from(&vec![Some(3i32), None, Some(1), Some(0)]).to(DataType::Int32);
+        let indices = PrimitiveArray::from([Some(3i32), None, Some(1), Some(0)]);
         let result = take(&array, &indices);
 
         let data_expected = vec![
@@ -189,7 +187,7 @@ mod tests {
             None,
         );
 
-        let indices = PrimitiveArray::from(&vec![Some(0i32), Some(1)]).to(DataType::Int32);
+        let indices = PrimitiveArray::from([Some(0i32), Some(1)]);
         let result = take(&nested, &indices);
 
         // expected data
diff --git a/src/io/json/write/serialize.rs b/src/io/json/write/serialize.rs
index eaf29bfe68..708019b6f8 100644
--- a/src/io/json/write/serialize.rs
+++ b/src/io/json/write/serialize.rs
@@ -344,7 +344,7 @@ fn set_column_for_json_rows(
 /// use arrow2::record_batch::RecordBatch;
 ///
 /// let schema = Arc::new(Schema::new(vec![Field::new("a", DataType::Int32, false)]));
-/// let a = PrimitiveArray::from_slice(&[1i32, 2, 3]).to(DataType::Int32);
+/// let a = PrimitiveArray::from_slice([1i32, 2, 3]);
 /// let batch = RecordBatch::try_new(schema, vec![Arc::new(a)]).unwrap();
 ///
 /// let json_rows = json::write_record_batches(&[batch]);
diff --git a/src/record_batch.rs b/src/record_batch.rs
index ddd171af54..6168693623 100644
--- a/src/record_batch.rs
+++ b/src/record_batch.rs
@@ -61,7 +61,7 @@ impl RecordBatch {
     /// # use arrow2::datatypes::{Schema, Field, DataType};
     /// # use arrow2::record_batch::RecordBatch;
     /// # fn main() -> arrow2::error::Result<()> {
-    /// let id_array = PrimitiveArray::from_slice(&[1i32, 2, 3, 4, 5]).to(DataType::Int32);
+    /// let id_array = PrimitiveArray::from_slice([1i32, 2, 3, 4, 5]);
     /// let schema = Arc::new(Schema::new(vec![
     ///     Field::new("id", DataType::Int32, false)
     /// ]));
@@ -180,7 +180,7 @@ impl RecordBatch {
     /// # use arrow2::datatypes::{Schema, Field, DataType};
     /// # use arrow2::record_batch::RecordBatch;
     /// # fn main() -> arrow2::error::Result<()> {
-    /// let id_array = PrimitiveArray::from_slice(&[1i32, 2, 3, 4, 5]).to(DataType::Int32);
+    /// let id_array = PrimitiveArray::from_slice([1i32, 2, 3, 4, 5]);
     /// let schema = Arc::new(Schema::new(vec![
     ///     Field::new("id", DataType::Int32, false)
     /// ]));
@@ -209,7 +209,7 @@ impl RecordBatch {
     /// # use arrow2::datatypes::{Schema, Field, DataType};
     /// # use arrow2::record_batch::RecordBatch;
     /// # fn main() -> arrow2::error::Result<()> {
-    /// let id_array = PrimitiveArray::from_slice(&[1i32, 2, 3, 4, 5]).to(DataType::Int32);
+    /// let id_array = PrimitiveArray::from_slice([1i32, 2, 3, 4, 5]);
     /// let schema = Arc::new(Schema::new(vec![
     ///     Field::new("id", DataType::Int32, false)
     /// ]));


Test patch:
diff --git a/arrow-pyarrow-integration-testing/src/lib.rs b/arrow-pyarrow-integration-testing/src/lib.rs
index 791a3cd0bd..666f433879 100644
--- a/arrow-pyarrow-integration-testing/src/lib.rs
+++ b/arrow-pyarrow-integration-testing/src/lib.rs
@@ -124,11 +124,8 @@ fn double(array: PyObject, py: Python) -> PyResult<PyObject> {
 #[pyfunction]
 fn double_py(lambda: PyObject, py: Python) -> PyResult<bool> {
     // create
-    let array =
-        Arc::new(PrimitiveArray::<i64>::from(vec![Some(1), None, Some(3)]).to(DataType::Int64));
-    let expected =
-        Arc::new(PrimitiveArray::<i64>::from(vec![Some(2), None, Some(6)]).to(DataType::Int64))
-            as ArrayRef;
+    let array = Arc::new(PrimitiveArray::<i64>::from(vec![Some(1), None, Some(3)]));
+    let expected = Arc::new(PrimitiveArray::<i64>::from(vec![Some(2), None, Some(6)])) as ArrayRef;
 
     // to py
     let array = to_py(array, py)?;
@@ -184,9 +181,7 @@ fn round_trip(array: PyObject, py: Python) -> PyResult<PyObject> {
 #[pyfunction]
 fn import_primitive(array: PyObject, py: Python) -> PyResult<bool> {
     let array = to_rust(array, py)?;
-    let expected =
-        Arc::new(PrimitiveArray::<i64>::from(vec![Some(2), None, Some(6)]).to(DataType::Int64))
-            as ArrayRef;
+    let expected = Arc::new(PrimitiveArray::<i64>::from(vec![Some(2), None, Some(6)])) as ArrayRef;
 
     Ok(array == expected)
 }
@@ -194,9 +189,7 @@ fn import_primitive(array: PyObject, py: Python) -> PyResult<bool> {
 /// Converts to rust and back to python
 #[pyfunction]
 fn export_primitive(py: Python) -> PyResult<PyObject> {
-    let array =
-        Arc::new(PrimitiveArray::<i64>::from(vec![Some(2), None, Some(6)]).to(DataType::Int64))
-            as ArrayRef;
+    let array = Arc::new(PrimitiveArray::<i64>::from(vec![Some(2), None, Some(6)])) as ArrayRef;
 
     let array = to_py(array, py)?;
 
diff --git a/tests/it/io/json/write.rs b/tests/it/io/json/write.rs
index 8c9cedd924..13337ec7bd 100644
--- a/tests/it/io/json/write.rs
+++ b/tests/it/io/json/write.rs
@@ -107,7 +107,7 @@ fn write_struct_with_list_field() {
     a.try_extend(iter).unwrap();
     let a: ListArray<i32> = a.into();
 
-    let b = PrimitiveArray::from_slice(&vec![1, 2, 3, 4, 5]).to(DataType::Int32);
+    let b = PrimitiveArray::from_slice([1, 2, 3, 4, 5]);
 
     let batch = RecordBatch::try_new(Arc::new(schema), vec![Arc::new(a), Arc::new(b)]).unwrap();
 
diff --git a/tests/it/io/parquet/mod.rs b/tests/it/io/parquet/mod.rs
index 4628dc9747..138538e32f 100644
--- a/tests/it/io/parquet/mod.rs
+++ b/tests/it/io/parquet/mod.rs
@@ -315,7 +315,7 @@ pub fn pyarrow_required(column: usize) -> Box<dyn Array> {
     ];
 
     match column {
-        0 => Box::new(PrimitiveArray::<i64>::from(i64_values).to(DataType::Int64)),
+        0 => Box::new(PrimitiveArray::<i64>::from(i64_values)),
         3 => Box::new(BooleanArray::from_slice(&[
             true, true, false, false, false, true, true, true, true, true,
         ])),