Fix clippy::match-wildcard-for-single-variants

This commit is contained in:
Héctor Ramón Jiménez 2023-09-20 05:03:25 +02:00
parent 42ed90bc6f
commit caed50b277
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
7 changed files with 41 additions and 11 deletions

View file

@ -1,2 +1,32 @@
[alias] [alias]
lint = "clippy --workspace --no-deps -- -D warnings -D clippy::semicolon_if_nothing_returned -D clippy::trivially-copy-pass-by-ref -D clippy::default_trait_access" lint = """
clippy --workspace --no-deps -- \
-D warnings \
-D clippy::semicolon_if_nothing_returned \
-D clippy::trivially-copy-pass-by-ref \
-D clippy::default_trait_access \
-D clippy::match-wildcard-for-single-variants
"""
nitpick = """
clippy --workspace --no-deps -- \
-D warnings \
-D clippy::pedantic \
-A clippy::must_use_candidate \
-A clippy::return_self_not_must_use \
-A clippy::needless_pass_by_value \
-A clippy::cast_precision_loss \
-A clippy::cast_sign_loss \
-A clippy::cast_possible_truncation \
-A clippy::match_same_arms \
-A clippy::missing-errors-doc \
-A clippy::missing-panics-doc \
-A clippy::cast_lossless \
-A clippy::doc_markdown \
-A clippy::items_after_statements \
-A clippy::too_many_lines \
-A clippy::module_name_repetitions \
-A clippy::if_not_else \
-A clippy::redundant_else \
-A clippy::used_underscore_binding
"""

View file

@ -123,7 +123,7 @@ impl Download {
| State::Errored { .. } => { | State::Errored { .. } => {
self.state = State::Downloading { progress: 0.0 }; self.state = State::Downloading { progress: 0.0 };
} }
_ => {} State::Downloading{ .. } => {}
} }
} }

View file

@ -472,7 +472,7 @@ mod grid {
* (1.0 / self.scaling), * (1.0 / self.scaling),
)) ))
} }
_ => None, Interaction::None => None,
}; };
let event_status = match interaction { let event_status = match interaction {
@ -676,7 +676,7 @@ mod grid {
Interaction::None if cursor.is_over(bounds) => { Interaction::None if cursor.is_over(bounds) => {
mouse::Interaction::Crosshair mouse::Interaction::Crosshair
} }
_ => mouse::Interaction::default(), Interaction::None => mouse::Interaction::default(),
} }
} }
} }

View file

@ -257,7 +257,7 @@ impl<T> crate::graphics::geometry::Renderer for Renderer<T> {
crate::Geometry::TinySkia(primitive) => { crate::Geometry::TinySkia(primitive) => {
renderer.draw_primitive(primitive); renderer.draw_primitive(primitive);
} }
_ => unreachable!(), crate::Geometry::Wgpu(_) => unreachable!(),
} }
} }
} }
@ -268,7 +268,7 @@ impl<T> crate::graphics::geometry::Renderer for Renderer<T> {
crate::Geometry::Wgpu(primitive) => { crate::Geometry::Wgpu(primitive) => {
renderer.draw_primitive(primitive); renderer.draw_primitive(primitive);
} }
_ => unreachable!(), crate::Geometry::TinySkia(_) => unreachable!(),
} }
} }
} }

View file

@ -237,7 +237,7 @@ impl Atlas {
})); }));
} }
} }
_ => {} Layer::Full => {}
} }
} }

View file

@ -117,7 +117,7 @@ impl Direction {
match self { match self {
Self::Horizontal(properties) => Some(properties), Self::Horizontal(properties) => Some(properties),
Self::Both { horizontal, .. } => Some(horizontal), Self::Both { horizontal, .. } => Some(horizontal),
_ => None, Self::Vertical(_) => None,
} }
} }
@ -126,7 +126,7 @@ impl Direction {
match self { match self {
Self::Vertical(properties) => Some(properties), Self::Vertical(properties) => Some(properties),
Self::Both { vertical, .. } => Some(vertical), Self::Both { vertical, .. } => Some(vertical),
_ => None, Self::Horizontal(_) => None,
} }
} }
} }

View file

@ -56,7 +56,7 @@ impl Cursor {
State::Selection { start, end } => { State::Selection { start, end } => {
Some((start.min(end), start.max(end))) Some((start.min(end), start.max(end)))
} }
_ => None, State::Index(_) => None,
} }
} }
@ -89,7 +89,7 @@ impl Cursor {
match self.state(value) { match self.state(value) {
State::Index(index) if index > 0 => self.move_to(index - 1), State::Index(index) if index > 0 => self.move_to(index - 1),
State::Selection { start, end } => self.move_to(start.min(end)), State::Selection { start, end } => self.move_to(start.min(end)),
_ => self.move_to(0), State::Index(_) => self.move_to(0),
} }
} }