Skip to content

Commit

Permalink
Run clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
H-Plus-Time committed Nov 30, 2023
1 parent 718eade commit 68bc327
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/arrow1/metadata.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::arrow1::error::WasmResult;

use wasm_bindgen::prelude::*;

/// Global Parquet metadata.
Expand Down
6 changes: 3 additions & 3 deletions src/arrow1/reader_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use parquet::file::footer::{decode_footer, decode_metadata};
use parquet::file::metadata::{FileMetaData, ParquetMetaData};
use range_reader::RangedAsyncReader;
use reqwest::Client;
use wasm_bindgen::prelude::*;


#[wasm_bindgen]
pub struct AsyncParquetFile {
Expand Down Expand Up @@ -108,7 +108,7 @@ impl AsyncParquetFile {
self.meta.clone(),
);
let stream = builder.with_row_groups(vec![i]).build()?;
let mut results = stream.try_collect::<Vec<_>>().await.unwrap();
let results = stream.try_collect::<Vec<_>>().await.unwrap();

// NOTE: This is not only one batch by default due to arrow-rs's default rechunking.
// assert_eq!(results.len(), 1, "Expected one record batch");
Expand All @@ -119,7 +119,7 @@ impl AsyncParquetFile {
#[wasm_bindgen]
pub async fn stream(&self, concurrency: Option<usize>) -> WasmResult<wasm_streams::readable::sys::ReadableStream> {
use futures::StreamExt;
let concurrency = concurrency.unwrap_or_else(|| 1);
let concurrency = concurrency.unwrap_or(1);
let meta = self.meta.clone();
// let reader = self.reader.clone();
let reader = self.alt_reader.clone();
Expand Down
38 changes: 19 additions & 19 deletions src/common/http_object_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use async_trait::async_trait;
use reqwest::{Client, Method, StatusCode, Response, RequestBuilder, header::{
LAST_MODIFIED, CONTENT_LENGTH, HeaderMap, ETAG
}};
use snafu::{OptionExt, ResultExt, Snafu, Error as SnafuError};
use snafu::{OptionExt, ResultExt, Snafu};

#[derive(Debug, Copy, Clone)]
/// Configuration for header extraction
Expand Down Expand Up @@ -197,9 +197,9 @@ impl InnerClient {
};
let builder = self.client.request(method, url).with_get_options(options);
let res_func = || async {
let res = builder.try_clone().unwrap()
.send().await;
res

builder.try_clone().unwrap()
.send().await
};
let res = res_func.retry(&ExponentialBuilder::default())
.await
Expand All @@ -211,7 +211,7 @@ impl InnerClient {
path: path.to_string(),
}
}
_ => Error::Generic { store: InnerClient::STORE, source: Box::new(source) }.into(),
_ => Error::Generic { store: InnerClient::STORE, source: Box::new(source) },
})?;

// We expect a 206 Partial Content response if a range was requested
Expand Down Expand Up @@ -267,15 +267,15 @@ impl InhouseObjectStore {
impl ObjectStore for InhouseObjectStore {
async fn abort_multipart(
&self,
location: &Path,
multipart_id: &object_store::MultipartId,
_location: &Path,
_multipart_id: &object_store::MultipartId,
) -> object_store::Result<()> {
todo!()
}
async fn copy(
&self,
from: &Path,
to: &Path,
_from: &Path,
_to: &Path,
) -> object_store::Result<()> {
todo!()
}
Expand All @@ -288,7 +288,7 @@ impl ObjectStore for InhouseObjectStore {
source: todo!(),
})
}
async fn delete(&self, location: &Path) -> object_store::Result<()> {
async fn delete(&self, _location: &Path) -> object_store::Result<()> {
todo!()
}

Expand All @@ -307,33 +307,33 @@ impl ObjectStore for InhouseObjectStore {

let data = receiver.await.unwrap();
let wrapped_stream = futures::stream::once(futures::future::ready(data.payload));
let out = Ok(GetResult {

Ok(GetResult {
range: data.range,
payload: GetResultPayload::Stream(Box::pin(wrapped_stream)),
meta: data.meta
});
out
})
}
async fn put_opts(
&self,
location: &Path,
bytes: Bytes,
options: object_store::PutOptions,
_location: &Path,
_bytes: Bytes,
_options: object_store::PutOptions,
) -> object_store::Result<object_store::PutResult> {
todo!()
}
fn list(&self, prefix: Option<&Path>) -> BoxStream<'_, object_store::Result<ObjectMeta>> {
fn list(&self, _prefix: Option<&Path>) -> BoxStream<'_, object_store::Result<ObjectMeta>> {
todo!()
}
async fn list_with_delimiter(
&self,
prefix: Option<&Path>,
_prefix: Option<&Path>,
) -> object_store::Result<object_store::ListResult> {
todo!()
}
async fn put_multipart(
&self,
location: &Path,
_location: &Path,
) -> object_store::Result<(
object_store::MultipartId,
Box<dyn tokio::io::AsyncWrite + Unpin + Send>,
Expand Down

0 comments on commit 68bc327

Please sign in to comment.