diff options
author | linbingquan <695601626@qq.com> | 2022-12-18 06:20:15 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-17 23:20:15 +0100 |
commit | f46df3e35940fc78163945eed33e58fafed0b06b (patch) | |
tree | c22233bf2019a254045ad0af533225d3f02a402f /cli/util | |
parent | f2c9cc500c84a3c6051823cd3ae33d6b4c1f6266 (diff) |
chore: update to Rust 1.66.0 (#17078)
Diffstat (limited to 'cli/util')
-rw-r--r-- | cli/util/fs.rs | 4 | ||||
-rw-r--r-- | cli/util/progress_bar/renderer.rs | 4 |
2 files changed, 3 insertions, 5 deletions
diff --git a/cli/util/fs.rs b/cli/util/fs.rs index 40dfafdd8..cb8a4d369 100644 --- a/cli/util/fs.rs +++ b/cli/util/fs.rs @@ -160,7 +160,7 @@ pub fn resolve_from_cwd(path: &Path) -> Result<PathBuf, AnyError> { cwd.join(path) }; - Ok(normalize_path(&resolved_path)) + Ok(normalize_path(resolved_path)) } /// Collects file paths that satisfy the given predicate, by recursively walking `files`. @@ -280,7 +280,7 @@ pub fn collect_specifiers( } else { root_path.join(path) }; - let p = normalize_path(&p); + let p = normalize_path(p); if p.is_dir() { let test_files = file_collector.collect_files(&[p])?; let mut test_files_as_urls = test_files diff --git a/cli/util/progress_bar/renderer.rs b/cli/util/progress_bar/renderer.rs index cb249ce36..75a4cafed 100644 --- a/cli/util/progress_bar/renderer.rs +++ b/cli/util/progress_bar/renderer.rs @@ -75,9 +75,7 @@ impl ProgressBarRenderer for BarProgressBarRenderer { )); } text.push_str(&elapsed_text); - let max_width = - std::cmp::max(10, std::cmp::min(75, data.terminal_width as i32 - 5)) - as usize; + let max_width = (data.terminal_width as i32 - 5).clamp(10, 75) as usize; let same_line_text_width = elapsed_text.len() + total_text_max_width + bytes_text_max_width + 3; // space, open and close brace let total_bars = if same_line_text_width > max_width { |