Skip to content

Commit

Permalink
fix: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
joshka committed May 25, 2024
1 parent 2088af8 commit db2b1a4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions examples/widget_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ impl Widget for &mut App {
self.squares.render(squares, buf);

self.green_square.render(squares, buf);

// display the position of the green square. This is updated automatically when the green
// square is rendered.
let green_square_position = format!(
"Green square is at ({},{})",
self.green_square.last_x, self.green_square.last_y
Expand Down Expand Up @@ -148,7 +151,7 @@ struct Timer {
}

impl Default for Timer {
fn default() -> Timer {
fn default() -> Self {
Self {
start: Instant::now(),
}
Expand Down Expand Up @@ -224,7 +227,7 @@ impl WidgetRef for BlueSquare {
/// just displays the coordinates as a string.
///
/// This approach was probably always available in Ratatui, but it wasn't widely used either. This
/// is an alternative to implementing the StatefulWidget trait, for situations where you want to
/// is an alternative to implementing the `StatefulWidget` trait, for situations where you want to
/// store the state in the widget itself instead of a separate struct.
#[derive(Default)]
struct RightAlignedSquare {
Expand Down

0 comments on commit db2b1a4

Please sign in to comment.