Fixed a warning and allowed two others
authorTomas Wenström <tomas.wenstrom@gmail.com>
Tue, 5 Jan 2021 15:53:52 +0000 (16:53 +0100)
committerTomas Wenström <tomas.wenstrom@gmail.com>
Tue, 5 Jan 2021 15:53:52 +0000 (16:53 +0100)
src/game/app.rs

index 4e0f97b..0ec34ee 100644 (file)
@@ -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();