[librsvg: 6/8] node.rs: Move related types closer to each other



commit bc13ed857550cbad513e5e8877ffbb27fdf3adb1
Author: Federico Mena Quintero <federico gnome org>
Date:   Fri May 10 18:26:40 2019 -0500

    node.rs: Move related types closer to each other

 rsvg_internals/src/node.rs | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)
---
diff --git a/rsvg_internals/src/node.rs b/rsvg_internals/src/node.rs
index bf99cae3..38f666e8 100644
--- a/rsvg_internals/src/node.rs
+++ b/rsvg_internals/src/node.rs
@@ -19,6 +19,22 @@ use locale_config::Locale;
 /// A strong reference to a node
 pub type RsvgNode = Rc<Node>;
 
+pub struct NodeData {
+    node_type: NodeType,
+    id: Option<String>,    // id attribute from XML element
+    class: Option<String>, // class attribute from XML element
+    specified_values: RefCell<SpecifiedValues>,
+    important_styles: RefCell<HashSet<Attribute>>,
+    result: RefCell<NodeResult>,
+    transform: Cell<Matrix>,
+    values: RefCell<ComputedValues>,
+    cond: Cell<bool>,
+    node_impl: Box<NodeTrait>,
+    style_attr: RefCell<String>,
+}
+
+pub type Node = tree_utils::Node<NodeData>;
+
 /// Can obtain computed values from a node
 ///
 /// In our tree of SVG elements (Node in our parlance), each node stores a `ComputedValues` that
@@ -141,22 +157,6 @@ impl_downcast!(NodeTrait);
 // validator, not a renderer like librsvg is.
 pub type NodeResult = Result<(), NodeError>;
 
-pub struct NodeData {
-    node_type: NodeType,
-    id: Option<String>,    // id attribute from XML element
-    class: Option<String>, // class attribute from XML element
-    specified_values: RefCell<SpecifiedValues>,
-    important_styles: RefCell<HashSet<Attribute>>,
-    result: RefCell<NodeResult>,
-    transform: Cell<Matrix>,
-    values: RefCell<ComputedValues>,
-    cond: Cell<bool>,
-    node_impl: Box<NodeTrait>,
-    style_attr: RefCell<String>,
-}
-
-pub type Node = tree_utils::Node<NodeData>;
-
 #[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
 pub enum NodeType {
     Chars,


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