This commit is contained in:
veeso
2023-01-13 12:47:21 +01:00
parent cb037cfca9
commit 62003308a7
8 changed files with 22 additions and 26 deletions

View File

@@ -63,7 +63,7 @@ pub fn fmt_path_elide(p: &Path, width: usize) -> String {
/// This function allows to specify an extra length to consider to elide path
pub fn fmt_path_elide_ex(p: &Path, width: usize, extra_len: usize) -> String {
let fmt_path: String = format!("{}", p.display());
match fmt_path.width() + extra_len > width as usize {
match fmt_path.width() + extra_len > width {
false => fmt_path,
true => {
// Elide