From 2a00624ee743a728bb6254d19ee1ecfcc9566ac2 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 31 Mar 2022 00:53:40 +0100 Subject: [PATCH] clippy: Miscellaneous minor changes Signed-off-by: Ian Jackson --- base/misc.rs | 2 +- base/zcoord.rs | 4 ++-- wasm/wasm.rs | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/base/misc.rs b/base/misc.rs index 47df4d6b..f966e5a9 100644 --- a/base/misc.rs +++ b/base/misc.rs @@ -50,7 +50,7 @@ pub use crate::display_as_debug; pub type SvgAttrs = Vec<(HtmlLit,Html)>; pub fn space_table_attrs(table_size: PosC) -> SvgAttrs { - let PosC { coords: [x, y] } = table_size.into(); + let PosC { coords: [x, y] } = table_size; vec![ (Html::lit("viewBox"), hformat!("0 0 {} {}", x, y) ), (Html::lit("width" ), (SVG_SCALE * x).to_html() ), diff --git a/base/zcoord.rs b/base/zcoord.rs index 44a88396..624d06db 100644 --- a/base/zcoord.rs +++ b/base/zcoord.rs @@ -584,8 +584,8 @@ impl ZCoord { for lt in s.chunks(TEXT_PER_LIMB) { if !lt[0..DIGITS_PER_LIMB].iter().all( |c: &u8| { - (b'0'..=b'9').contains(&c) || - (b'a'..=b'v').contains(&c) + (b'0'..=b'9').contains(c) || + (b'a'..=b'v').contains(c) }) { throw!(ParseError) } match lt[DIGITS_PER_LIMB..] { [] | [b'_'] => (), diff --git a/wasm/wasm.rs b/wasm/wasm.rs index 98c5249f..77f2bd5b 100644 --- a/wasm/wasm.rs +++ b/wasm/wasm.rs @@ -98,6 +98,8 @@ pub fn range(a: &JsValue, b: &JsValue, count: zcoord::RangeCount) #[wasm_bindgen] impl ZCoordIterator { + #[allow(clippy::should_implement_trait)] + // ^ Yes, but WASM can't call the trait method pub fn next(&mut self) -> JsValue { let packed = match self.0.next() { None => return JsValue::NULL, -- 2.30.2