[librsvg: 7/8] Use matches! instead of match
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 7/8] Use matches! instead of match
- Date: Wed, 2 Jun 2021 15:34:40 +0000 (UTC)
commit 86a3a490aed7b1a1672f6cb7f1bac93bc1c563e8
Author: Federico Mena Quintero <federico gnome org>
Date: Tue Jun 1 21:03:40 2021 -0500
Use matches! instead of match
src/drawing_ctx.rs | 44 +++++++++++++++++++++-----------------------
1 file changed, 21 insertions(+), 23 deletions(-)
---
diff --git a/src/drawing_ctx.rs b/src/drawing_ctx.rs
index d7bc5e6e..83133490 100644
--- a/src/drawing_ctx.rs
+++ b/src/drawing_ctx.rs
@@ -1674,35 +1674,33 @@ impl DrawingCtx {
// https://www.w3.org/TR/css-masking-1/#ClipPathElement
fn element_can_be_used_inside_clip_path(element: &Element) -> bool {
- match *element {
+ matches!(
+ *element,
Element::Circle(_)
- | Element::Ellipse(_)
- | Element::Line(_)
- | Element::Path(_)
- | Element::Polygon(_)
- | Element::Polyline(_)
- | Element::Rect(_)
- | Element::Text(_)
- | Element::Use(_) => true,
-
- _ => false,
- }
+ | Element::Ellipse(_)
+ | Element::Line(_)
+ | Element::Path(_)
+ | Element::Polygon(_)
+ | Element::Polyline(_)
+ | Element::Rect(_)
+ | Element::Text(_)
+ | Element::Use(_)
+ )
}
// https://www.w3.org/TR/css-masking-1/#ClipPathElement
fn element_can_be_used_inside_use_inside_clip_path(element: &Element) -> bool {
- match *element {
+ matches!(
+ *element,
Element::Circle(_)
- | Element::Ellipse(_)
- | Element::Line(_)
- | Element::Path(_)
- | Element::Polygon(_)
- | Element::Polyline(_)
- | Element::Rect(_)
- | Element::Text(_) => true,
-
- _ => false,
- }
+ | Element::Ellipse(_)
+ | Element::Line(_)
+ | Element::Path(_)
+ | Element::Polygon(_)
+ | Element::Polyline(_)
+ | Element::Rect(_)
+ | Element::Text(_)
+ )
}
#[derive(Debug)]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]