summaryrefslogtreecommitdiffstats
path: root/src/parse.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse.rs')
-rw-r--r--src/parse.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/parse.rs b/src/parse.rs
index a90323c3..167ae272 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -94,15 +94,13 @@ pub fn relativize_path_in_diff_stat_line(
{
if let Some(relative_path) = relative_path.to_str() {
let suffix = caps.get(2).unwrap().as_str();
- let pad_width = diff_stat_align_width
- .checked_sub(relative_path.len())
- .unwrap_or(0);
+ let pad_width = diff_stat_align_width.saturating_sub(relative_path.len());
let padding = " ".repeat(pad_width);
return Some(format!(" {}{}{}", relative_path, padding, suffix));
}
}
}
- return None;
+ None
}
pub fn get_file_extension_from_file_meta_line_file_path(path: &str) -> Option<&str> {