From: Tomas Wenström Date: Tue, 5 Jan 2021 15:53:52 +0000 (+0100) Subject: Fixed a warning and allowed two others X-Git-Url: http://dolda2000.com/gitweb/?p=kaka%2Frust-sdl-test.git;a=commitdiff_plain;h=98995f2b580d872a5a21b34869fe024fafdf4260 Fixed a warning and allowed two others --- diff --git a/src/game/app.rs b/src/game/app.rs index 4e0f97b..0ec34ee 100644 --- a/src/game/app.rs +++ b/src/game/app.rs @@ -82,7 +82,7 @@ impl AppBuilder { canvas, event_pump, sprites, - state: self.state.unwrap_or(Box::new(ActiveState::new())), + state: self.state.unwrap_or_else(|| Box::new(ActiveState::new())), }) } @@ -131,6 +131,7 @@ pub struct App { } impl App { + #[allow(clippy::new_ret_no_self)] pub fn new() -> AppBuilder { Default::default() } @@ -364,6 +365,7 @@ impl ActiveState { } fn change_boll_count(&mut self, delta: i32) { + #[allow(clippy::comparison_chain)] if delta > 0 { for _i in 0..delta { self.add_boll();