Skip to content

Commit c367dde

Browse files
Derive rather than impl Default for Fill (#152)
1 parent f3e1a98 commit c367dde

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/style.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use kurbo::Stroke;
77
///
88
/// This is only relevant for self-intersecting paths (e.g. a hourglass shape).
99
/// For non-self-intersecting paths, both rules produce the same result.
10-
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
10+
#[derive(Copy, Clone, Default, PartialEq, Eq, Debug)]
1111
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1212
#[repr(u8)]
1313
pub enum Fill {
@@ -16,6 +16,7 @@ pub enum Fill {
1616
/// All regions where the winding number of the path is not zero will be filled.
1717
/// This is generally more correct, but can be more expensive to implement in renderers.
1818
/// This matches the default behavior of the web canvas, and is the default value.
19+
#[default]
1920
NonZero = 0,
2021
/// Even-odd fill rule.
2122
///
@@ -42,12 +43,6 @@ pub enum Style {
4243
Stroke(Stroke),
4344
}
4445

45-
impl Default for Fill {
46-
fn default() -> Self {
47-
Self::NonZero
48-
}
49-
}
50-
5146
impl From<Fill> for Style {
5247
fn from(fill: Fill) -> Self {
5348
Self::Fill(fill)

0 commit comments

Comments
 (0)