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 {
799799 /// If `None`, creates a new [`DefaultFileStatisticsCache`] scoped to this query.
800800 pub fn with_cache ( mut self , cache : Option < FileStatisticsCache > ) -> Self {
801801 self . collected_statistics =
802- cache. unwrap_or ( Arc :: new ( DefaultFileStatisticsCache :: default ( ) ) ) ;
802+ cache. unwrap_or_else ( || Arc :: new ( DefaultFileStatisticsCache :: default ( ) ) ) ;
803803 self
804804 }
805805
Original file line number Diff line number Diff line change 2222#![ cfg_attr( docsrs, feature( doc_auto_cfg) ) ]
2323// Make sure fast / cheap clones on Arc are explicit:
2424// 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+ ) ]
2637#![ warn( missing_docs, clippy:: needless_borrow) ]
2738
2839//! [DataFusion] is an extensible query engine written in Rust that
You can’t perform that action at this time.
0 commit comments