diff --git a/Cargo.toml b/Cargo.toml index 932c5a597c..d843e4e906 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/src/layout/constraint.rs b/src/layout/constraint.rs index d5d41ddef8..c7b7bd101b 100644 --- a/src/layout/constraint.rs +++ b/src/layout/constraint.rs @@ -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), } diff --git a/src/text/line.rs b/src/text/line.rs index 1a636f783d..06213fc4d1 100644 --- a/src/text/line.rs +++ b/src/text/line.rs @@ -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 {