Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A couple suggestions from clippy #8

Merged
merged 1 commit into from
Mar 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use arrow2::io::parquet::write::{
};
use std::io::Cursor;

use wasm_bindgen;
use wasm_bindgen::prelude::*;

// A macro to provide `println!(..)`-style syntax for `console.log` logging.
Expand Down Expand Up @@ -77,7 +76,7 @@ pub fn read_parquet(parquet_file: &[u8]) -> Result<Uint8Array, JsValue> {
Err(error) => return Err(JsValue::from_str(format!("{}", error).as_str())),
};

return Ok(unsafe { Uint8Array::view(&output_file) });
Ok(unsafe { Uint8Array::view(&output_file) })
}

#[wasm_bindgen(js_name = writeParquet)]
Expand Down Expand Up @@ -134,6 +133,8 @@ pub fn write_parquet(arrow_file: &[u8]) -> Result<Uint8Array, JsValue> {
encodings,
);

// TODO: from clippy:
// for loop over `row_groups`, which is a `Result`. This is more readably written as an `if let` statement
for group in row_groups {
for maybe_column in group {
let column = match maybe_column {
Expand All @@ -151,7 +152,7 @@ pub fn write_parquet(arrow_file: &[u8]) -> Result<Uint8Array, JsValue> {
}
let _size = parquet_writer.end(None);

return Ok(unsafe { Uint8Array::view(&output_file) });
Ok(unsafe { Uint8Array::view(&output_file) })
}

#[wasm_bindgen(js_name = setPanicHook)]
Expand Down