eat warnings
authoralfadur
Thu, 01 Jul 2021 00:17:05 +0300
changeset 15812 8c39a11f7756
parent 15811 a855f32ab3ca
child 15813 ad79e5c0885c
eat warnings
rust/hedgewars-checker/src/main.rs
--- a/rust/hedgewars-checker/src/main.rs	Wed Jun 30 23:06:54 2021 +0200
+++ b/rust/hedgewars-checker/src/main.rs	Thu Jul 01 00:17:05 2021 +0300
@@ -98,7 +98,8 @@
         buf.read_from(&mut stream)?;
 
         while let Ok((tail, msg)) = parser::server_message(buf.as_ref()) {
-            buf.consume(buf.len() - tail.len());
+            let tail_len = tail.len();
+            buf.consume(buf.len() - tail_len);
 
             match msg {
                 Connected(_, _) => {
@@ -154,14 +155,14 @@
                     info!("Chat [{}]: {}", nick, msg);
                 }
                 RoomAdd(fields) => {
-                    let mut l = fields.into_iter();
+                    let l = fields.into_iter();
                     info!("Room added: {}", l.skip(1).next().unwrap());
                 }
                 RoomUpdated(name, fields) => {
-                    let mut l = fields.into_iter();
+                    let l = fields.into_iter();
                     let new_name = l.skip(1).next().unwrap();
 
-                    if (name != new_name) {
+                    if name != new_name {
                         info!("Room renamed: {}", new_name);
                     }
                 }