mirror of
https://github.com/ratatui-org/ratatui
synced 2024-11-10 07:04:17 +00:00
refactor: clippy::uninlined_format_args (#974)
This commit is contained in:
parent
14b24e7585
commit
fcbea9ee68
6 changed files with 13 additions and 13 deletions
|
@ -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"
|
||||
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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})"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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}"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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})"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue