[librsvg: 11/17] Move Declaration to properties.rs



commit df2f15fff5a61a40a0948073c59e796b80e829b3
Author: Federico Mena Quintero <federico gnome org>
Date:   Thu May 2 19:03:48 2019 -0500

    Move Declaration to properties.rs

 rsvg_internals/src/css.rs        | 10 +---------
 rsvg_internals/src/properties.rs |  7 +++++++
 2 files changed, 8 insertions(+), 9 deletions(-)
---
diff --git a/rsvg_internals/src/css.rs b/rsvg_internals/src/css.rs
index 20911f65..aa461f18 100644
--- a/rsvg_internals/src/css.rs
+++ b/rsvg_internals/src/css.rs
@@ -14,17 +14,9 @@ use crate::attributes::Attribute;
 use crate::croco::*;
 use crate::error::LoadingError;
 use crate::io::{self, BinaryData};
-use crate::properties::{
-    parse_attribute_value_into_parsed_property, ParsedProperty, SpecifiedValues,
-};
+use crate::properties::{parse_attribute_value_into_parsed_property, Declaration, SpecifiedValues};
 use crate::util::utf8_cstr;
 
-struct Declaration {
-    attribute: Attribute,
-    property: ParsedProperty,
-    important: bool,
-}
-
 // Maps property_name -> Declaration
 type DeclarationList = HashMap<Attribute, Declaration>;
 
diff --git a/rsvg_internals/src/properties.rs b/rsvg_internals/src/properties.rs
index 6c4890bd..2d175de2 100644
--- a/rsvg_internals/src/properties.rs
+++ b/rsvg_internals/src/properties.rs
@@ -13,6 +13,13 @@ use crate::property_bag::PropertyBag;
 use crate::property_macros::Property;
 use crate::unit_interval::UnitInterval;
 
+/// A parsed CSS declaration (`name: value [!important]`)
+pub struct Declaration {
+    pub attribute: Attribute,
+    pub property: ParsedProperty,
+    pub important: bool,
+}
+
 /// Representation of a single CSS property value.
 ///
 /// `Unspecified` is the `Default`; it means that the corresponding property is not present.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]