chiark / gitweb /
clippy: Miscellaneous minor changes
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 30 Mar 2022 23:53:40 +0000 (00:53 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 30 Mar 2022 23:59:17 +0000 (00:59 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
base/misc.rs
base/zcoord.rs
wasm/wasm.rs

index 47df4d6bc009abe372f58721146e4ecd78d3b908..f966e5a914f6719dd202c5a1006519e0d9c73ac0 100644 (file)
@@ -50,7 +50,7 @@ pub use crate::display_as_debug;
 pub type SvgAttrs = Vec<(HtmlLit,Html)>;
 
 pub fn space_table_attrs(table_size: PosC<f64>) -> 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()  ),
index 44a88396fde0e4da80ac3be2a5aff98924476310..624d06db272c55155bc6a8ffc0546c60910f1eaa 100644 (file)
@@ -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'_'] => (),
index 98c5249f8b0f2d63d3df68a1a738904e3073c710..77f2bd5b1c81250db22fa9e8f2a52e99c0ab38c0 100644 (file)
@@ -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,