Skip to content

Commit

Permalink
fix all clippy lints
Browse files Browse the repository at this point in the history
Signed-off-by: remzi <13716567376yh@gmail.com>
  • Loading branch information
HaoYang670 committed Feb 25, 2022
1 parent 7bdaa72 commit c7bb81a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
6 changes: 1 addition & 5 deletions arrow/src/json/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1271,11 +1271,7 @@ impl Decoder {
.iter()
.enumerate()
.map(|(i, row)| {
(
i,
row.as_object()
.and_then(|v| v.get(field.name())),
)
(i, row.as_object().and_then(|v| v.get(field.name())))
})
.map(|(i, v)| match v {
// we want the field as an object, if it's not, we treat as null
Expand Down
5 changes: 2 additions & 3 deletions parquet/src/arrow/array_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1769,14 +1769,13 @@ impl<'a> ArrayReaderBuilder {
// get the optional timezone information from arrow type
let timezone = arrow_type
.as_ref()
.map(|data_type| {
.and_then(|data_type| {
if let ArrowType::Timestamp(_, tz) = data_type {
tz.clone()
} else {
None
}
})
.flatten();
});
let converter = Int96Converter::new(Int96ArrayConverter { timezone });
Ok(Box::new(ComplexObjectArrayReader::<
Int96Type,
Expand Down
4 changes: 2 additions & 2 deletions parquet/src/arrow/levels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -713,8 +713,8 @@ impl LevelInfo {
DataType::List(_) | DataType::Map(_, _) => {
let offsets = unsafe { array.data().buffers()[0].typed_data::<i32>() };
let offsets = offsets
.to_vec()
.into_iter()
.iter()
.copied()
.skip(array.offset() + offset)
.take(len + 1)
.map(|v| v as i64)
Expand Down
2 changes: 1 addition & 1 deletion parquet/src/util/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ mod tests {
let mut target = vec![];
let cursor_res = cursor.read_to_end(&mut target);
println!("{:?}", cursor_res);
assert!(!cursor_res.is_err(), "reading error");
assert!(cursor_res.is_ok(), "reading error");
assert_eq!((end_included - start) as usize + 1, cursor_res.unwrap());
assert_eq!((start..=end_included).collect::<Vec<_>>(), target);
}
Expand Down

0 comments on commit c7bb81a

Please sign in to comment.