chiark / gitweb /
clippy: Miscellaneous minor changes
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 31 Mar 2022 00:03:04 +0000 (01:03 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 31 Mar 2022 00:03:04 +0000 (01:03 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
clippy-options
src/bundles.rs
src/hand.rs
src/movehist.rs
src/pcrender.rs

index f6261925d7ccd6325a6fb2f3eb28bd8a62cdd376..c8a71c48d451c442540bfc2af9611a95ca52afde 100644 (file)
@@ -7,3 +7,4 @@
 -A clippy::let_and_return
 -A clippy::needless_lifetimes
 -A clippy::upper_case_acronyms
+-A clippy::unused_unit
index a6f3dbafdbd1d4999f3dfb3d6107d176a21abf02..b0399746d7958d352a499af19da348e7d1bc9c3c 100644 (file)
@@ -659,7 +659,7 @@ fn parse_bundle<EH>(id: Id, instance: &InstanceName,
       zf.read_to_string(&mut catalogue_data)
         .map_err(|e| LE::badlib(&libname, &e))?;
       let mut src = LibraryInBundle {
-        catalogue_data: catalogue_data,
+        catalogue_data,
         svg_dir: &svg_dir,
         need_svgs: Vec::new(),
         id: &id,
index 721a2c83fdc4b3df5415661824c2a7a4e5ae4ffd..ba48ab3cb4e9178bdf8158e901141cf5aabc97ed 100644 (file)
@@ -4,7 +4,7 @@
 
 use crate::prelude::*;
 
-pub const UNCLAIMED_HAND_DESC: &'static str = "a hand repository";
+pub const UNCLAIMED_HAND_DESC: &str = "a hand repository";
 
 #[derive(Debug,Clone,Serialize,Deserialize)]
 struct MagicOwner {
index 327752a2e7652ccdbe8bcc56cf89ed7f2560cdbd..8259df8c45b715f402bb533074d078233e6db5da 100644 (file)
@@ -123,7 +123,7 @@ pub fn peek_prep_update(gs: &mut GameState, peek: &PreparedUpdateEntry)
       }
 
       if let Some(held) = ns.held {
-        ent.insert(PlHistLast { held: held, posx: new_posx });
+        ent.insert(PlHistLast { held, posx: new_posx });
       } else {
         ent.remove();
       }
index 3f7e5a737a1eea84e5c590c987c8daa69076c5dc..2387dc6a5319662c4bc87d38443df9666e17872b 100644 (file)
@@ -123,10 +123,8 @@ impl PieceRenderInstructions {
       .map(|r| JsonString(r.clone()));
     let (svg, bbox) = pri.make_defs(ioccults, gs, gpc, ipc)?;
     let r = PreparedPieceState {
-      pos        : pos,
+      pos, svg, occregion, bbox,
       held       : gpc.held,
-      svg        : svg,
-      bbox       : bbox,
       z          : zlevel.z.clone(),
       zg         : zlevel.zg,
       angle      : pri.angle(gpc).to_compass(),
@@ -135,7 +133,6 @@ impl PieceRenderInstructions {
       uos        : pri.ui_operations(gs, gpc, ipc)?,
       moveable   : gpc.moveable(),
       facehint   : pri.facehint(gpc),
-      occregion,
     };
     dbgc!(pri, ipc, gpc, r);
     r
@@ -148,9 +145,8 @@ impl PieceRenderInstructions {
     let pri = self;
     let (svg, bbox) = pri.make_defs(ioccults, gs, gpc, ipc)?;
     let r = PreparedPieceImage {
-      svg        : svg,
-      bbox       : bbox,
-      uos        : pri.ui_operations(gs, gpc, ipc)?,
+      svg, bbox,
+      uos: pri.ui_operations(gs, gpc, ipc)?,
     };
     dbgc!(pri, ipc, gpc, r);
     r