Address clippy lints

This commit is contained in:
Alexandru Macovei
2021-01-14 01:00:41 +02:00
committed by andy.boot
parent a48c7782ac
commit 998e7fb2f8
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -309,7 +309,7 @@ fn get_name_percent(
bar_chart: &str,
display_data: &DisplayData,
) -> (String, String) {
if bar_chart != "" {
if !bar_chart.is_empty() {
let percent_size_str = format!("{:.0}%", display_data.percent_size(node) * 100.0);
let percents = format!("{}{:>4}", bar_chart, percent_size_str);
let name_and_padding = pad_or_trim_filename(node, indent, display_data);
+4 -2
View File
@@ -1,7 +1,6 @@
use std::cmp::Ordering;
use std::collections::HashMap;
use std::collections::HashSet;
use std::iter::FromIterator;
use std::path::{Path, PathBuf};
use std::sync::atomic::AtomicBool;
@@ -149,7 +148,10 @@ pub fn get_dir_tree<P: AsRef<Path>>(
let permissions_flag = AtomicBool::new(false);
let not_found_flag = AtomicBool::new(false);
let t2 = HashSet::from_iter(top_level_names.iter().map(|p| p.as_ref().to_path_buf()));
let t2 = top_level_names
.iter()
.map(|p| p.as_ref().to_path_buf())
.collect();
let t = create_reader_thread(rx, t2, apparent_size);
let walk_dir_builder = prepare_walk_dir_builder(top_level_names, limit_filesystem, show_hidden);