Skip to content

Commit 21847da

Browse files
committed
Fix fmt
1 parent eda0953 commit 21847da

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

datafusion/common/src/heap_size.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ use arrow::datatypes::{
2626
};
2727
use chrono::{DateTime, Utc};
2828
use half::f16;
29+
use object_store::path::Path;
2930
use std::collections::HashMap;
3031
use std::fmt::Debug;
3132
use std::sync::Arc;
32-
use object_store::path::Path;
3333

3434
/// This is a temporary solution until <https://github.com/apache/datafusion/pull/19599> and
3535
/// <https://github.com/apache/arrow-rs/pull/9138> are resolved.
@@ -182,7 +182,7 @@ impl DFHeapSize for DataType {
182182

183183
impl DFHeapSize for Path {
184184
fn heap_size(&self) -> usize {
185-
self.as_ref().heap_size()
185+
self.as_ref().heap_size()
186186
}
187187
}
188188

datafusion/execution/src/cache/cache_unit.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,16 @@
1616
// under the License.
1717

1818
use crate::cache::CacheAccessor;
19-
use crate::cache::cache_manager::{CachedFileMetadata, FileMetadataCache, FileStatisticsCache, FileStatisticsCacheEntry};
19+
use crate::cache::cache_manager::{
20+
CachedFileMetadata, FileMetadataCache, FileStatisticsCache, FileStatisticsCacheEntry,
21+
};
22+
use object_store::path::Path;
2023
use std::collections::HashMap;
2124
use std::sync::Mutex;
2225

2326
pub use crate::cache::DefaultFilesMetadataCache;
2427
use crate::cache::lru_queue::LruQueue;
2528
use datafusion_common::heap_size::DFHeapSize;
26-
use object_store::path::Path;
2729

2830
/// Default implementation of [`FileStatisticsCache`]
2931
///
@@ -548,7 +550,10 @@ mod tests {
548550
let (meta_2, value_2) = create_cached_file_metadata_with_stats("test2.parquet");
549551
let (meta_3, value_3) = create_cached_file_metadata_with_stats("test3.parquet");
550552

551-
let limit_for_2_entries = &meta_1.location.heap_size() + value_1.heap_size() + &meta_2.location.heap_size() + value_2.heap_size();
553+
let limit_for_2_entries = &meta_1.location.heap_size()
554+
+ value_1.heap_size()
555+
+ &meta_2.location.heap_size()
556+
+ value_2.heap_size();
552557

553558
// create a cache with a limit which fits exactly 2 entries
554559
let cache = DefaultFileStatisticsCache::new(limit_for_2_entries);
@@ -580,7 +585,10 @@ mod tests {
580585

581586
cache.remove(&meta_2.location);
582587
assert_eq!(cache.len(), 1);
583-
assert_eq!(cache.memory_used(), &meta_3.location.heap_size() + value_3.heap_size());
588+
assert_eq!(
589+
cache.memory_used(),
590+
&meta_3.location.heap_size() + value_3.heap_size()
591+
);
584592

585593
cache.clear();
586594
assert_eq!(cache.len(), 0);

0 commit comments

Comments
 (0)