From: Ian Jackson Date: Thu, 31 Mar 2022 00:03:04 +0000 (+0100) Subject: clippy: Miscellaneous minor changes X-Git-Tag: otter-1.0.0~57 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=ead4a55ae990be772a6ee639a988f6e4367ff339;p=otter.git clippy: Miscellaneous minor changes Signed-off-by: Ian Jackson --- diff --git a/clippy-options b/clippy-options index f6261925..c8a71c48 100644 --- a/clippy-options +++ b/clippy-options @@ -7,3 +7,4 @@ -A clippy::let_and_return -A clippy::needless_lifetimes -A clippy::upper_case_acronyms +-A clippy::unused_unit diff --git a/src/bundles.rs b/src/bundles.rs index a6f3dbaf..b0399746 100644 --- a/src/bundles.rs +++ b/src/bundles.rs @@ -659,7 +659,7 @@ fn parse_bundle(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, diff --git a/src/hand.rs b/src/hand.rs index 721a2c83..ba48ab3c 100644 --- a/src/hand.rs +++ b/src/hand.rs @@ -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 { diff --git a/src/movehist.rs b/src/movehist.rs index 327752a2..8259df8c 100644 --- a/src/movehist.rs +++ b/src/movehist.rs @@ -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(); } diff --git a/src/pcrender.rs b/src/pcrender.rs index 3f7e5a73..2387dc6a 100644 --- a/src/pcrender.rs +++ b/src/pcrender.rs @@ -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