Skip to content

Commit

Permalink
Refactor StructArray::from (#1360)
Browse files Browse the repository at this point in the history
* add async to default features

Signed-off-by: remzi <13716567376yh@gmail.com>

* rewrite

Signed-off-by: remzi <13716567376yh@gmail.com>

* update

Signed-off-by: remzi <13716567376yh@gmail.com>
  • Loading branch information
HaoYang670 committed Feb 24, 2022
1 parent ef95e52 commit 57545b0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions arrow/src/array/array_struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,12 @@ impl StructArray {

impl From<ArrayData> for StructArray {
fn from(data: ArrayData) -> Self {
let mut boxed_fields = vec![];
for cd in data.child_data() {
boxed_fields.push(make_array(cd.clone()));
}
let boxed_fields = data
.child_data()
.iter()
.map(|cd| make_array(cd.clone()))
.collect();

Self { data, boxed_fields }
}
}
Expand Down

0 comments on commit 57545b0

Please sign in to comment.