Skip to content

Commit aee30bf

Browse files
committed
refactor(cubesql): Fix manual_map warning
1 parent f6cace5 commit aee30bf

File tree

3 files changed

+2
-10
lines changed

3 files changed

+2
-10
lines changed

rust/cubesql/cubesql/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ len_without_is_empty = "allow"
105105
len_zero = "allow"
106106
let_and_return = "allow"
107107
manual_flatten = "allow"
108-
manual_map = "allow"
109108
manual_range_contains = "allow"
110109
manual_strip = "allow"
111110
map_clone = "allow"

rust/cubesql/cubesql/src/compile/engine/df/scan.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -754,11 +754,7 @@ impl CubeScanOneShotStream {
754754
}
755755

756756
fn poll_next(&mut self) -> Option<ArrowResult<RecordBatch>> {
757-
if let Some(batch) = self.data.take() {
758-
Some(Ok(batch))
759-
} else {
760-
None
761-
}
757+
self.data.take().map(Ok)
762758
}
763759
}
764760

rust/cubesql/cubesql/src/compile/engine/udf/common.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2237,10 +2237,7 @@ pub fn create_pg_get_constraintdef_udf() -> ScalarUDF {
22372237
let oids_arr = downcast_primitive_arg!(args[0], "oid", OidType);
22382238
let result = oids_arr
22392239
.iter()
2240-
.map(|oid| match oid {
2241-
Some(_oid) => Some("PRIMARY KEY (oid)".to_string()),
2242-
_ => None,
2243-
})
2240+
.map(|oid| oid.map(|_oid| "PRIMARY KEY (oid)".to_string()))
22442241
.collect::<StringArray>();
22452242

22462243
Ok(Arc::new(result))

0 commit comments

Comments
 (0)