Skip to content

Commit fee946e

Browse files
committed
fix: Clippy suggestions
1 parent 86506ce commit fee946e

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ fn construct_config(mut opts: Opts, pattern_regexps: &[String]) -> Result<Config
277277
threads: opts.threads().get(),
278278
max_buffer_time: match opts.sort {
279279
// If sorting is enabled, then set max_buffer_time to practically infinity.
280-
Some(_) => Some(Duration::from_hours(24 * 365 * 10)), // 10 years - arbitrarily-large.
280+
Some(_) => Some(Duration::from_secs(3600 * 24 * 365 * 10)), // 10 years - arbitrarily-large.
281281
None => opts.max_buffer_time,
282282
},
283283
max_buffer_size: match opts.sort {

src/walk.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,9 @@ impl WorkerState {
689689
}
690690
}
691691

692-
fn dir_entry_key_fn(sort_key: SortKey) -> Box<dyn Fn(&DirEntry) -> Option<SortKeyValue>> {
692+
type SortKeyValueFn = Box<dyn Fn(&DirEntry) -> Option<SortKeyValue>>;
693+
694+
fn dir_entry_key_fn(sort_key: SortKey) -> SortKeyValueFn {
693695
match sort_key {
694696
SortKey::Path => Box::new(|e| Some(SortKeyValue::Path(e.path().to_path_buf()))),
695697
SortKey::Size => Box::new(|e| e.metadata().map(|m| SortKeyValue::Size(m.len()))),

0 commit comments

Comments
 (0)