From 98995f2b580d872a5a21b34869fe024fafdf4260 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tomas=20Wenstr=C3=B6m?= Date: Tue, 5 Jan 2021 16:53:52 +0100 Subject: [PATCH] Fixed a warning and allowed two others --- src/game/app.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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(); -- 2.11.0