Skip to content

Commit

Permalink
Fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
lewiszlw committed Mar 6, 2024
1 parent 1a91567 commit 5bfc4b0
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/function/box2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,11 @@ impl ScalarUDFImpl for Box2dUdf {
let wkb_arr = arr.as_binary::<i32>();
let mut box2d_vec: Vec<Option<Box2D>> = vec![];
for i in 0..wkb_arr.geom_len() {
box2d_vec.push(wkb_arr.geo_value(i)?.and_then(|geom| {
geom.bounding_rect()
.and_then(|rect| Some(Box2D::from(rect)))
}));
box2d_vec.push(
wkb_arr
.geo_value(i)?
.and_then(|geom| geom.bounding_rect().map(Box2D::from)),
);
}
let arr = build_box2d_array(box2d_vec);
Ok(ColumnarValue::Array(Arc::new(arr)))
Expand All @@ -62,10 +63,11 @@ impl ScalarUDFImpl for Box2dUdf {
let wkb_arr = arr.as_binary::<i64>();
let mut box2d_vec: Vec<Option<Box2D>> = vec![];
for i in 0..wkb_arr.geom_len() {
box2d_vec.push(wkb_arr.geo_value(i)?.and_then(|geom| {
geom.bounding_rect()
.and_then(|rect| Some(Box2D::from(rect)))
}));
box2d_vec.push(
wkb_arr
.geo_value(i)?
.and_then(|geom| geom.bounding_rect().map(Box2D::from)),
);
}
let arr = build_box2d_array(box2d_vec);
Ok(ColumnarValue::Array(Arc::new(arr)))
Expand Down

0 comments on commit 5bfc4b0

Please sign in to comment.