mirror of
https://github.com/gitui-org/gitui
synced 2026-05-24 09:28:21 +00:00
fix clippy warning
This commit is contained in:
parent
bfbde25116
commit
2b45a039d1
1 changed files with 6 additions and 5 deletions
|
|
@ -169,17 +169,18 @@ impl DiffComponent {
|
||||||
.modifier(Modifier::BOLD);
|
.modifier(Modifier::BOLD);
|
||||||
|
|
||||||
let filled = if selected {
|
let filled = if selected {
|
||||||
|
// selected line
|
||||||
format!(
|
format!(
|
||||||
"{:w$}\n",
|
"{:w$}\n",
|
||||||
line.content.trim_matches('\n'),
|
line.content.trim_matches('\n'),
|
||||||
w = width as usize
|
w = width as usize
|
||||||
)
|
)
|
||||||
|
} else if line.content.matches('\n').count() == 1 {
|
||||||
|
// regular line, no selection (cheapest)
|
||||||
|
line.content.clone()
|
||||||
} else {
|
} else {
|
||||||
if line.content.matches('\n').count() == 1 {
|
// weird eof missing eol line
|
||||||
line.content.clone()
|
format!("{}\n", line.content.trim_matches('\n'))
|
||||||
} else {
|
|
||||||
format!("{}\n", line.content.trim_matches('\n'))
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
let content = Cow::from(filled);
|
let content = Cow::from(filled);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue