From 905da12c2f7802ed842a94192f837d42f9c5f0ca Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 13 Dec 2021 23:30:56 -0500 Subject: clean up clippy stuff --- src/cell.rs | 1 - src/grid.rs | 3 --- src/lib.rs | 4 +--- src/row.rs | 1 - src/screen.rs | 5 ++--- tests/helpers/fixtures.rs | 4 +--- tests/helpers/mod.rs | 1 - tests/quickcheck.rs | 1 - tests/scroll.rs | 1 - 9 files changed, 4 insertions(+), 17 deletions(-) diff --git a/src/cell.rs b/src/cell.rs index 857c9e2..1b44461 100644 --- a/src/cell.rs +++ b/src/cell.rs @@ -10,7 +10,6 @@ pub struct Cell { attrs: crate::attrs::Attrs, } -#[allow(clippy::collapsible_if)] impl PartialEq for Cell { fn eq(&self, other: &Self) -> bool { if self.len != other.len { diff --git a/src/grid.rs b/src/grid.rs index bde6726..3c9b540 100644 --- a/src/grid.rs +++ b/src/grid.rs @@ -332,9 +332,6 @@ impl Grid { } let cell = self.drawing_cell(pos).unwrap(); if cell.has_contents() { - // not sure why this is triggering here, seems like a - // clippy bug - #[allow(clippy::option_if_let_else)] if let Some(prev_pos) = prev_pos { if prev_pos.row != i || prev_pos.col < self.size.cols diff --git a/src/lib.rs b/src/lib.rs index 2397b3f..bfc977b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -33,14 +33,12 @@ //! ); //! ``` -// XXX this is broken with ale -// #![warn(clippy::cargo)] +#![warn(clippy::cargo)] #![warn(clippy::pedantic)] #![warn(clippy::nursery)] #![allow(clippy::cognitive_complexity)] #![allow(clippy::missing_const_for_fn)] #![allow(clippy::missing_panics_doc)] -#![allow(clippy::single_match)] #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] diff --git a/src/row.rs b/src/row.rs index d60d48b..79db354 100644 --- a/src/row.rs +++ b/src/row.rs @@ -277,7 +277,6 @@ impl Row { // while it's true that most of the logic in this is identical to // write_contents_formatted, i can't figure out how to break out the // common parts without making things noticeably slower. - #[allow(clippy::too_many_lines)] pub fn write_contents_diff( &self, contents: &mut Vec, diff --git a/src/screen.rs b/src/screen.rs index c885242..24f461c 100644 --- a/src/screen.rs +++ b/src/screen.rs @@ -826,10 +826,7 @@ impl Screen { } } -// unclear why putting this attribute on the individual methods doesn't work -#[allow(clippy::unused_self)] impl Screen { - #[allow(clippy::too_many_lines)] fn text(&mut self, c: char) { let pos = self.grid().pos(); let size = self.grid().size(); @@ -1161,6 +1158,7 @@ impl Screen { } // CSI h + #[allow(clippy::unused_self)] fn sm(&mut self, params: &vte::Params) { // nothing, i think? if log::log_enabled!(log::Level::Debug) { @@ -1211,6 +1209,7 @@ impl Screen { } // CSI l + #[allow(clippy::unused_self)] fn rm(&mut self, params: &vte::Params) { // nothing, i think? if log::log_enabled!(log::Level::Debug) { diff --git a/tests/helpers/fixtures.rs b/tests/helpers/fixtures.rs index f2076fb..c0f8b75 100644 --- a/tests/helpers/fixtures.rs +++ b/tests/helpers/fixtures.rs @@ -33,6 +33,7 @@ pub struct FixtureCell { } impl FixtureCell { + #[allow(dead_code)] pub fn from_cell(cell: &vt100::Cell) -> Self { Self { contents: cell.contents(), @@ -149,7 +150,6 @@ where } } -#[allow(clippy::trivially_copy_pass_by_ref)] fn serialize_color( color: &vt100::Color, serializer: S, @@ -182,7 +182,6 @@ where } } -#[allow(clippy::trivially_copy_pass_by_ref)] fn serialize_mouse_protocol_mode( mode: &vt100::MouseProtocolMode, serializer: S, @@ -215,7 +214,6 @@ where } } -#[allow(clippy::trivially_copy_pass_by_ref)] fn serialize_mouse_protocol_encoding( encoding: &vt100::MouseProtocolEncoding, serializer: S, diff --git a/tests/helpers/mod.rs b/tests/helpers/mod.rs index 53e4f42..dc08ce5 100644 --- a/tests/helpers/mod.rs +++ b/tests/helpers/mod.rs @@ -125,7 +125,6 @@ pub fn compare_screens( true } -#[allow(dead_code)] pub fn contents_formatted_reproduces_state(input: &[u8]) -> bool { let mut parser = vt100::Parser::default(); parser.process(input); diff --git a/tests/quickcheck.rs b/tests/quickcheck.rs index 64fd027..efb6f63 100644 --- a/tests/quickcheck.rs +++ b/tests/quickcheck.rs @@ -24,7 +24,6 @@ impl quickcheck::Arbitrary for TerminalInput { } } -#[allow(clippy::many_single_char_names)] fn choose_terminal_input_fragment(g: &mut G) -> Vec { enum Fragment { Text, diff --git a/tests/scroll.rs b/tests/scroll.rs index 94eb5bc..21e0ae6 100644 --- a/tests/scroll.rs +++ b/tests/scroll.rs @@ -10,7 +10,6 @@ fn origin_mode() { helpers::fixture("origin_mode"); } -#[allow(clippy::cognitive_complexity)] #[test] fn scrollback() { let mut parser = vt100::Parser::new(24, 80, 10); -- cgit v1.2.3-54-g00ecf