Skip to content

Commit 3639e9c

Browse files
clippy suggestions
1 parent c0e4d84 commit 3639e9c

File tree

5 files changed

+18
-9
lines changed

5 files changed

+18
-9
lines changed

src/static_schema.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ pub struct Fields {
5656
metadata: HashMap<String, String>,
5757
}
5858

59-
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
60-
pub struct Metadata {}
6159
pub fn convert_static_schema_to_arrow_schema(
6260
static_schema: StaticSchema,
6361
time_partition: &str,

src/storage/azure_blob.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ impl BlobStore {
426426

427427
// let mut upload_parts = Vec::new();
428428

429-
let has_final_partial_part = total_size % MIN_MULTIPART_UPLOAD_SIZE > 0;
429+
let has_final_partial_part = !total_size.is_multiple_of(MIN_MULTIPART_UPLOAD_SIZE);
430430
let num_full_parts = total_size / MIN_MULTIPART_UPLOAD_SIZE;
431431
let total_parts = num_full_parts + if has_final_partial_part { 1 } else { 0 };
432432

src/storage/gcs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ impl Gcs {
367367
let mut data = Vec::new();
368368
file.read_to_end(&mut data).await?;
369369

370-
let has_final_partial_part = total_size % MIN_MULTIPART_UPLOAD_SIZE > 0;
370+
let has_final_partial_part = !total_size.is_multiple_of(MIN_MULTIPART_UPLOAD_SIZE);
371371
let num_full_parts = total_size / MIN_MULTIPART_UPLOAD_SIZE;
372372
let total_parts = num_full_parts + if has_final_partial_part { 1 } else { 0 };
373373

src/storage/localfs.rs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ impl ObjectStorage for LocalFS {
239239
async fn get_objects(
240240
&self,
241241
base_path: Option<&RelativePath>,
242-
filter_func: Box<(dyn Fn(String) -> bool + std::marker::Send + 'static)>,
242+
filter_func: Box<dyn Fn(String) -> bool + std::marker::Send + 'static>,
243243
) -> Result<Vec<Bytes>, ObjectStorageError> {
244244
let prefix = if let Some(path) = base_path {
245245
path.to_path(&self.root)
@@ -278,6 +278,18 @@ impl ObjectStorage for LocalFS {
278278
let file_result = fs::read(entry.path()).await;
279279
match file_result {
280280
Ok(file) => {
281+
// Record total files scanned
282+
increment_files_scanned_in_object_store_calls_by_date(
283+
"localfs",
284+
"GET",
285+
1,
286+
&Utc::now().date_naive().to_string(),
287+
);
288+
increment_object_store_calls_by_date(
289+
"localfs",
290+
"GET",
291+
&Utc::now().date_naive().to_string(),
292+
);
281293
res.push(file.into());
282294
}
283295
Err(err) => {
@@ -286,16 +298,15 @@ impl ObjectStorage for LocalFS {
286298
}
287299
}
288300

289-
// Record total files scanned
290301
increment_files_scanned_in_object_store_calls_by_date(
291302
"localfs",
292-
"GET",
303+
"LIST",
293304
files_scanned as u64,
294305
&Utc::now().date_naive().to_string(),
295306
);
296307
increment_object_store_calls_by_date(
297308
"localfs",
298-
"GET",
309+
"LIST",
299310
&Utc::now().date_naive().to_string(),
300311
);
301312

src/storage/s3.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ impl S3 {
532532

533533
// let mut upload_parts = Vec::new();
534534

535-
let has_final_partial_part = total_size % MIN_MULTIPART_UPLOAD_SIZE > 0;
535+
let has_final_partial_part = !total_size.is_multiple_of(MIN_MULTIPART_UPLOAD_SIZE);
536536
let num_full_parts = total_size / MIN_MULTIPART_UPLOAD_SIZE;
537537
let total_parts = num_full_parts + if has_final_partial_part { 1 } else { 0 };
538538

0 commit comments

Comments
 (0)