File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -799,7 +799,7 @@ impl ListingTable {
799
799
/// If `None`, creates a new [`DefaultFileStatisticsCache`] scoped to this query.
800
800
pub fn with_cache ( mut self , cache : Option < FileStatisticsCache > ) -> Self {
801
801
self . collected_statistics =
802
- cache. unwrap_or ( Arc :: new ( DefaultFileStatisticsCache :: default ( ) ) ) ;
802
+ cache. unwrap_or_else ( || Arc :: new ( DefaultFileStatisticsCache :: default ( ) ) ) ;
803
803
self
804
804
}
805
805
Original file line number Diff line number Diff line change 22
22
#![ cfg_attr( docsrs, feature( doc_auto_cfg) ) ]
23
23
// Make sure fast / cheap clones on Arc are explicit:
24
24
// https://github.com/apache/datafusion/issues/11143
25
- #![ cfg_attr( not( test) , deny( clippy:: clone_on_ref_ptr) ) ]
25
+ //
26
+ // Eliminate unnecessary function calls(some may be not cheap) due to `xxx_or`
27
+ // for performance. Also avoid abusing `xxx_or_else` for readability:
28
+ // https://github.com/apache/datafusion/issues/15802
29
+ #![ cfg_attr(
30
+ not( test) ,
31
+ deny(
32
+ clippy:: clone_on_ref_ptr,
33
+ clippy:: or_fun_call,
34
+ clippy:: unnecessary_lazy_evaluations
35
+ )
36
+ ) ]
26
37
#![ warn( missing_docs, clippy:: needless_borrow) ]
27
38
28
39
//! [DataFusion] is an extensible query engine written in Rust that
You can’t perform that action at this time.
0 commit comments