summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-09-20 05:03:25 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-09-20 05:03:25 +0200
commitcaed50b277495e4375975f3f4e271b8fcbc0c33f (patch)
tree35e20b9c578b22598ca618e0bd34f9b619e7d176
parent42ed90bc6f92b2085d193e7f143430b8d3847c21 (diff)
downloadiced-caed50b277495e4375975f3f4e271b8fcbc0c33f.tar.gz
iced-caed50b277495e4375975f3f4e271b8fcbc0c33f.tar.bz2
iced-caed50b277495e4375975f3f4e271b8fcbc0c33f.zip
Fix `clippy::match-wildcard-for-single-variants`
-rw-r--r--.cargo/config.toml32
-rw-r--r--examples/download_progress/src/main.rs2
-rw-r--r--examples/game_of_life/src/main.rs4
-rw-r--r--renderer/src/lib.rs4
-rw-r--r--wgpu/src/image/atlas.rs2
-rw-r--r--widget/src/scrollable.rs4
-rw-r--r--widget/src/text_input/cursor.rs4
7 files changed, 41 insertions, 11 deletions
diff --git a/.cargo/config.toml b/.cargo/config.toml
index f5c00d9b..83564651 100644
--- a/.cargo/config.toml
+++ b/.cargo/config.toml
@@ -1,2 +1,32 @@
[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
+"""
diff --git a/examples/download_progress/src/main.rs b/examples/download_progress/src/main.rs
index 001a1f8f..e52c604c 100644
--- a/examples/download_progress/src/main.rs
+++ b/examples/download_progress/src/main.rs
@@ -123,7 +123,7 @@ impl Download {
| State::Errored { .. } => {
self.state = State::Downloading { progress: 0.0 };
}
- _ => {}
+ State::Downloading{ .. } => {}
}
}
diff --git a/examples/game_of_life/src/main.rs b/examples/game_of_life/src/main.rs
index 437d89d5..c774e769 100644
--- a/examples/game_of_life/src/main.rs
+++ b/examples/game_of_life/src/main.rs
@@ -472,7 +472,7 @@ mod grid {
* (1.0 / self.scaling),
))
}
- _ => None,
+ Interaction::None => None,
};
let event_status = match interaction {
@@ -676,7 +676,7 @@ mod grid {
Interaction::None if cursor.is_over(bounds) => {
mouse::Interaction::Crosshair
}
- _ => mouse::Interaction::default(),
+ Interaction::None => mouse::Interaction::default(),
}
}
}
diff --git a/renderer/src/lib.rs b/renderer/src/lib.rs
index 8c76f52e..1347ce04 100644
--- a/renderer/src/lib.rs
+++ b/renderer/src/lib.rs
@@ -257,7 +257,7 @@ impl<T> crate::graphics::geometry::Renderer for Renderer<T> {
crate::Geometry::TinySkia(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) => {
renderer.draw_primitive(primitive);
}
- _ => unreachable!(),
+ crate::Geometry::TinySkia(_) => unreachable!(),
}
}
}
diff --git a/wgpu/src/image/atlas.rs b/wgpu/src/image/atlas.rs
index e8ca4bd3..789e35b4 100644
--- a/wgpu/src/image/atlas.rs
+++ b/wgpu/src/image/atlas.rs
@@ -237,7 +237,7 @@ impl Atlas {
}));
}
}
- _ => {}
+ Layer::Full => {}
}
}
diff --git a/widget/src/scrollable.rs b/widget/src/scrollable.rs
index 4cc97684..49aed2f0 100644
--- a/widget/src/scrollable.rs
+++ b/widget/src/scrollable.rs
@@ -117,7 +117,7 @@ impl Direction {
match self {
Self::Horizontal(properties) => Some(properties),
Self::Both { horizontal, .. } => Some(horizontal),
- _ => None,
+ Self::Vertical(_) => None,
}
}
@@ -126,7 +126,7 @@ impl Direction {
match self {
Self::Vertical(properties) => Some(properties),
Self::Both { vertical, .. } => Some(vertical),
- _ => None,
+ Self::Horizontal(_) => None,
}
}
}
diff --git a/widget/src/text_input/cursor.rs b/widget/src/text_input/cursor.rs
index ea902485..f682b17d 100644
--- a/widget/src/text_input/cursor.rs
+++ b/widget/src/text_input/cursor.rs
@@ -56,7 +56,7 @@ impl Cursor {
State::Selection { start, end } => {
Some((start.min(end), start.max(end)))
}
- _ => None,
+ State::Index(_) => None,
}
}
@@ -89,7 +89,7 @@ impl Cursor {
match self.state(value) {
State::Index(index) if index > 0 => self.move_to(index - 1),
State::Selection { start, end } => self.move_to(start.min(end)),
- _ => self.move_to(0),
+ State::Index(_) => self.move_to(0),
}
}