refactor: clippy::uninlined_format_args (#974)

This commit is contained in:
EdJoPaTo 2024-03-02 13:10:32 +01:00 committed by Josh McKinney
parent 14b24e7585
commit fcbea9ee68
No known key found for this signature in database
GPG key ID: 722287396A903BC5
6 changed files with 13 additions and 13 deletions

View file

@ -85,6 +85,7 @@ return_self_not_must_use = "warn"
semicolon_if_nothing_returned = "warn" semicolon_if_nothing_returned = "warn"
too_many_lines = "warn" too_many_lines = "warn"
trivially_copy_pass_by_ref = "warn" trivially_copy_pass_by_ref = "warn"
uninlined_format_args = "warn"
unreadable_literal = "warn" unreadable_literal = "warn"
use_self = "warn" use_self = "warn"

View file

@ -297,7 +297,6 @@ mod tests {
format!( format!(
r#""{multi_byte_char}" Hidden by multi-width symbols: [(1, " "), (2, " "), (3, " "), (4, " "), (5, " "), (6, " "), (7, " ")] 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] #[test]
fn display() { fn display() {
let backend = TestBackend::new(10, 2); let backend = TestBackend::new(10, 2);
assert_eq!(format!("{}", backend), "\" \"\n\" \"\n"); assert_eq!(format!("{backend}"), "\" \"\n\" \"\n");
} }
#[test] #[test]

View file

@ -366,12 +366,12 @@ impl Default for Constraint {
impl Display for Constraint { impl Display for Constraint {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self { match self {
Self::Percentage(p) => write!(f, "Percentage({})", p), Self::Percentage(p) => write!(f, "Percentage({p})"),
Self::Ratio(n, d) => write!(f, "Ratio({}, {})", n, d), Self::Ratio(n, d) => write!(f, "Ratio({n}, {d})"),
Self::Length(l) => write!(f, "Length({})", l), Self::Length(l) => write!(f, "Length({l})"),
Self::Fill(l) => write!(f, "Fill({})", l), Self::Fill(l) => write!(f, "Fill({l})"),
Self::Max(m) => write!(f, "Max({})", m), Self::Max(m) => write!(f, "Max({m})"),
Self::Min(m) => write!(f, "Min({})", m), Self::Min(m) => write!(f, "Min({m})"),
} }
} }
} }

View file

@ -269,8 +269,8 @@ impl Display for Color {
Self::LightMagenta => write!(f, "LightMagenta"), Self::LightMagenta => write!(f, "LightMagenta"),
Self::LightCyan => write!(f, "LightCyan"), Self::LightCyan => write!(f, "LightCyan"),
Self::White => write!(f, "White"), Self::White => write!(f, "White"),
Self::Rgb(r, g, b) => write!(f, "#{:02X}{:02X}{:02X}", r, g, b), Self::Rgb(r, g, b) => write!(f, "#{r:02X}{g:02X}{b:02X}"),
Self::Indexed(i) => write!(f, "{}", i), Self::Indexed(i) => write!(f, "{i}"),
} }
} }
} }

View file

@ -32,8 +32,8 @@ impl fmt::Display for Viewport {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self { match self {
Self::Fullscreen => write!(f, "Fullscreen"), Self::Fullscreen => write!(f, "Fullscreen"),
Self::Inline(height) => write!(f, "Inline({})", height), Self::Inline(height) => write!(f, "Inline({height})"),
Self::Fixed(area) => write!(f, "Fixed({})", area), Self::Fixed(area) => write!(f, "Fixed({area})"),
} }
} }
} }

View file

@ -508,7 +508,7 @@ mod tests {
impl StatefulWidgetRef for PersonalGreeting { impl StatefulWidgetRef for PersonalGreeting {
type State = String; type State = String;
fn render_ref(&self, area: Rect, buf: &mut Buffer, state: &mut Self::State) { 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);
} }
} }