summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/length.rs11
-rw-r--r--src/transform.rs9
2 files changed, 5 insertions, 15 deletions
diff --git a/src/length.rs b/src/length.rs
index f5656cbe..5d91b166 100644
--- a/src/length.rs
+++ b/src/length.rs
@@ -505,16 +505,11 @@ pub type Length<N> = CssLength<N, Signed>;
/// Alias for `CssLength` types that are non negative
pub type ULength<N> = CssLength<N, Unsigned>;
-#[derive(Debug, PartialEq, Copy, Clone)]
+#[derive(Debug, Default, PartialEq, Copy, Clone)]
pub enum LengthOrAuto<N: Normalize> {
- Length(CssLength<N, Unsigned>),
+ #[default]
Auto,
-}
-
-impl<N: Normalize> Default for LengthOrAuto<N> {
- fn default() -> Self {
- LengthOrAuto::Auto
- }
+ Length(CssLength<N, Unsigned>),
}
impl<N: Normalize> Parse for LengthOrAuto<N> {
diff --git a/src/transform.rs b/src/transform.rs
index a042b778..9f6c6789 100644
--- a/src/transform.rs
+++ b/src/transform.rs
@@ -68,8 +68,9 @@ pub struct Transform {
/// The `transform` property from the CSS Transforms Module Level 1.
///
/// CSS Transforms 1: <https://www.w3.org/TR/css-transforms-1/#transform-property>
-#[derive(Debug, Clone, PartialEq)]
+#[derive(Debug, Default, Clone, PartialEq)]
pub enum TransformProperty {
+ #[default]
None,
List(Vec<TransformFunction>),
}
@@ -80,12 +81,6 @@ pub enum TransformProperty {
#[derive(Copy, Clone, Default, Debug, PartialEq)]
pub struct TransformAttribute(Transform);
-impl Default for TransformProperty {
- fn default() -> Self {
- TransformProperty::None
- }
-}
-
impl Property for TransformProperty {
fn inherits_automatically() -> bool {
false