fix clippy warning

This commit is contained in:
Stephan Dilly 2020-03-27 10:41:46 +01:00
parent bfbde25116
commit 2b45a039d1

View file

@ -169,17 +169,18 @@ impl DiffComponent {
.modifier(Modifier::BOLD);
let filled = if selected {
// selected line
format!(
"{:w$}\n",
line.content.trim_matches('\n'),
w = width as usize
)
} else if line.content.matches('\n').count() == 1 {
// regular line, no selection (cheapest)
line.content.clone()
} else {
if line.content.matches('\n').count() == 1 {
line.content.clone()
} else {
format!("{}\n", line.content.trim_matches('\n'))
}
// weird eof missing eol line
format!("{}\n", line.content.trim_matches('\n'))
};
let content = Cow::from(filled);