From f4c4e2ee4a2727e45bb362a3a44009249908b068 Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Sun, 17 Mar 2024 02:18:39 -0700 Subject: [PATCH] Enable the case-arms clippy checks --- saphyr/src/lib.rs | 2 -- saphyr/src/scanner.rs | 3 +-- saphyr/src/yaml.rs | 3 +-- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/saphyr/src/lib.rs b/saphyr/src/lib.rs index abb41c8..5c5ca2b 100644 --- a/saphyr/src/lib.rs +++ b/saphyr/src/lib.rs @@ -30,12 +30,10 @@ //! //! ``` -#![doc(html_root_url = "https://docs.rs/yaml-rust2/0.5.0")] #![cfg_attr(feature = "cargo-clippy", warn(clippy::pedantic))] #![cfg_attr( feature = "cargo-clippy", allow( - clippy::match_same_arms, clippy::should_implement_trait, clippy::missing_errors_doc, clippy::missing_panics_doc, diff --git a/saphyr/src/scanner.rs b/saphyr/src/scanner.rs index dff285b..226f801 100644 --- a/saphyr/src/scanner.rs +++ b/saphyr/src/scanner.rs @@ -786,7 +786,6 @@ impl> Scanner { loop { // TODO(chenyh) BOM match self.look_ch() { - ' ' => self.skip_blank(), // Tabs may not be used as indentation. // "Indentation" only exists as long as a block is started, but does not exist // inside of flow-style constructs. Tabs are allowed as part of leading @@ -806,7 +805,7 @@ impl> Scanner { )); } } - '\t' => self.skip_blank(), + '\t' | ' ' => self.skip_blank(), '\n' | '\r' => { self.lookahead(2); self.skip_line(); diff --git a/saphyr/src/yaml.rs b/saphyr/src/yaml.rs index 328775d..50d0b85 100644 --- a/saphyr/src/yaml.rs +++ b/saphyr/src/yaml.rs @@ -81,7 +81,7 @@ impl MarkedEventReceiver for YamlLoader { fn on_event(&mut self, ev: Event, _: Marker) { // println!("EV {:?}", ev); match ev { - Event::DocumentStart => { + Event::DocumentStart | Event::Nothing | Event::StreamStart | Event::StreamEnd => { // do nothing } Event::DocumentEnd => { @@ -156,7 +156,6 @@ impl MarkedEventReceiver for YamlLoader { }; self.insert_new_node((n, 0)); } - _ => { /* ignore */ } } // println!("DOC {:?}", self.doc_stack); }