Skip to content

Commit 45f247e

Browse files
committed
fix: collapse nested if statements for clippy compliance
1 parent b27a855 commit 45f247e

2 files changed

Lines changed: 16 additions & 16 deletions

File tree

src/table.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,10 @@ impl DuckLakeTable {
298298
&resolved_delete_path,
299299
validated_file_size(delete_file.file_size_bytes, &resolved_delete_path)?,
300300
);
301-
if let Some(footer_size) = delete_file.footer_size {
302-
if footer_size > 0 {
303-
pf = pf.with_metadata_size_hint(footer_size as usize);
304-
}
301+
if let Some(footer_size) = delete_file.footer_size
302+
&& footer_size > 0
303+
{
304+
pf = pf.with_metadata_size_hint(footer_size as usize);
305305
}
306306

307307
// Create file scan config for the delete file
@@ -359,10 +359,10 @@ impl DuckLakeTable {
359359

360360
// Apply footer size hint if available from DuckLake metadata
361361
// This reduces I/O from 2 reads to 1 read per file (especially beneficial for S3/MinIO)
362-
if let Some(footer_size) = table_file.file.footer_size {
363-
if footer_size > 0 {
364-
pf = pf.with_metadata_size_hint(footer_size as usize);
365-
}
362+
if let Some(footer_size) = table_file.file.footer_size
363+
&& footer_size > 0
364+
{
365+
pf = pf.with_metadata_size_hint(footer_size as usize);
366366
}
367367

368368
Ok(pf)
@@ -439,10 +439,10 @@ impl DuckLakeTable {
439439
&resolved_path,
440440
validated_file_size(table_file.file.file_size_bytes, &resolved_path)?,
441441
);
442-
if let Some(footer_size) = table_file.file.footer_size {
443-
if footer_size > 0 {
444-
pf = pf.with_metadata_size_hint(footer_size as usize);
445-
}
442+
if let Some(footer_size) = table_file.file.footer_size
443+
&& footer_size > 0
444+
{
445+
pf = pf.with_metadata_size_hint(footer_size as usize);
446446
}
447447

448448
// Use read_schema (with original Parquet names) for reading

src/table_changes.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -447,10 +447,10 @@ impl TableChangesTable {
447447
&resolved_path,
448448
validated_file_size(data_file.file_size_bytes, &resolved_path)?,
449449
);
450-
if let Some(footer_size) = data_file.footer_size {
451-
if footer_size > 0 {
452-
pf = pf.with_metadata_size_hint(footer_size as usize);
453-
}
450+
if let Some(footer_size) = data_file.footer_size
451+
&& footer_size > 0
452+
{
453+
pf = pf.with_metadata_size_hint(footer_size as usize);
454454
}
455455

456456
// Determine what to read from Parquet

0 commit comments

Comments
 (0)