diff --git a/Cargo.toml b/Cargo.toml index 4fe38d74..2a347bc1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -85,6 +85,7 @@ return_self_not_must_use = "warn" semicolon_if_nothing_returned = "warn" too_many_lines = "warn" trivially_copy_pass_by_ref = "warn" +uninlined_format_args = "warn" unreadable_literal = "warn" use_self = "warn" diff --git a/src/backend/test.rs b/src/backend/test.rs index 2b85a88c..052a5ec7 100644 --- a/src/backend/test.rs +++ b/src/backend/test.rs @@ -297,7 +297,6 @@ mod tests { format!( r#""{multi_byte_char}" Hidden by multi-width symbols: [(1, " "), (2, " "), (3, " "), (4, " "), (5, " "), (6, " "), (7, " ")] "#, - multi_byte_char = multi_byte_char ) ); } @@ -333,7 +332,7 @@ mod tests { #[test] fn display() { let backend = TestBackend::new(10, 2); - assert_eq!(format!("{}", backend), "\" \"\n\" \"\n"); + assert_eq!(format!("{backend}"), "\" \"\n\" \"\n"); } #[test] diff --git a/src/layout/constraint.rs b/src/layout/constraint.rs index b856f7d0..d5d41dde 100644 --- a/src/layout/constraint.rs +++ b/src/layout/constraint.rs @@ -366,12 +366,12 @@ impl Default for Constraint { impl Display for Constraint { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - Self::Percentage(p) => write!(f, "Percentage({})", p), - Self::Ratio(n, d) => write!(f, "Ratio({}, {})", n, d), - Self::Length(l) => write!(f, "Length({})", l), - Self::Fill(l) => write!(f, "Fill({})", l), - Self::Max(m) => write!(f, "Max({})", m), - Self::Min(m) => write!(f, "Min({})", m), + Self::Percentage(p) => write!(f, "Percentage({p})"), + Self::Ratio(n, d) => write!(f, "Ratio({n}, {d})"), + Self::Length(l) => write!(f, "Length({l})"), + Self::Fill(l) => write!(f, "Fill({l})"), + Self::Max(m) => write!(f, "Max({m})"), + Self::Min(m) => write!(f, "Min({m})"), } } } diff --git a/src/style/color.rs b/src/style/color.rs index 9e012280..ea73a4eb 100644 --- a/src/style/color.rs +++ b/src/style/color.rs @@ -269,8 +269,8 @@ impl Display for Color { Self::LightMagenta => write!(f, "LightMagenta"), Self::LightCyan => write!(f, "LightCyan"), Self::White => write!(f, "White"), - Self::Rgb(r, g, b) => write!(f, "#{:02X}{:02X}{:02X}", r, g, b), - Self::Indexed(i) => write!(f, "{}", i), + Self::Rgb(r, g, b) => write!(f, "#{r:02X}{g:02X}{b:02X}"), + Self::Indexed(i) => write!(f, "{i}"), } } } diff --git a/src/terminal/viewport.rs b/src/terminal/viewport.rs index 14df6e1d..85e934bb 100644 --- a/src/terminal/viewport.rs +++ b/src/terminal/viewport.rs @@ -32,8 +32,8 @@ impl fmt::Display for Viewport { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { Self::Fullscreen => write!(f, "Fullscreen"), - Self::Inline(height) => write!(f, "Inline({})", height), - Self::Fixed(area) => write!(f, "Fixed({})", area), + Self::Inline(height) => write!(f, "Inline({height})"), + Self::Fixed(area) => write!(f, "Fixed({area})"), } } } diff --git a/src/widgets.rs b/src/widgets.rs index 5c8968fc..2a7bd8ee 100644 --- a/src/widgets.rs +++ b/src/widgets.rs @@ -508,7 +508,7 @@ mod tests { impl StatefulWidgetRef for PersonalGreeting { type State = String; fn render_ref(&self, area: Rect, buf: &mut Buffer, state: &mut Self::State) { - Line::from(format!("Hello {}", state)).render(area, buf); + Line::from(format!("Hello {state}")).render(area, buf); } }