mirror of
https://github.com/ratatui-org/ratatui
synced 2024-11-10 07:04:17 +00:00
refactor: clippy::match_same_arms (#974)
This commit is contained in:
parent
a4e84a6a7f
commit
060d26b6dc
3 changed files with 3 additions and 4 deletions
|
@ -77,6 +77,7 @@ if_not_else = "warn"
|
|||
implicit_clone = "warn"
|
||||
inefficient_to_string = "warn"
|
||||
items_after_statements = "warn"
|
||||
match_same_arms = "warn"
|
||||
missing_const_for_fn = "warn"
|
||||
needless_for_each = "warn"
|
||||
needless_pass_by_value = "warn"
|
||||
|
|
|
@ -209,8 +209,7 @@ impl Constraint {
|
|||
let length = f32::from(length);
|
||||
(percentage * length).min(length) as u16
|
||||
}
|
||||
Self::Length(l) => length.min(l),
|
||||
Self::Fill(l) => length.min(l),
|
||||
Self::Length(l) | Self::Fill(l) => length.min(l),
|
||||
Self::Max(m) => length.min(m),
|
||||
Self::Min(m) => length.max(m),
|
||||
}
|
||||
|
|
|
@ -464,10 +464,9 @@ impl WidgetRef for Line<'_> {
|
|||
buf.set_style(area, self.style);
|
||||
let width = self.width() as u16;
|
||||
let offset = match self.alignment {
|
||||
Some(Alignment::Left) => 0,
|
||||
Some(Alignment::Center) => (area.width.saturating_sub(width)) / 2,
|
||||
Some(Alignment::Right) => area.width.saturating_sub(width),
|
||||
None => 0,
|
||||
Some(Alignment::Left) | None => 0,
|
||||
};
|
||||
let mut x = area.left().saturating_add(offset);
|
||||
for span in &self.spans {
|
||||
|
|
Loading…
Reference in a new issue