[librsvg: 22/48] NodeCreationContext: provide a little constructor for the initial case



commit 971688ee70680c5452b9e90612e83569dff4108e
Author: Federico Mena Quintero <federico gnome org>
Date:   Fri Sep 7 15:14:46 2018 -0500

    NodeCreationContext: provide a little constructor for the initial case

 rsvg_internals/src/xml.rs | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/rsvg_internals/src/xml.rs b/rsvg_internals/src/xml.rs
index b09b91fd..23918ea3 100644
--- a/rsvg_internals/src/xml.rs
+++ b/rsvg_internals/src/xml.rs
@@ -109,6 +109,10 @@ impl XmlHandler for NodeCreationContext {
 }
 
 impl NodeCreationContext {
+    fn empty() -> NodeCreationContext {
+        NodeCreationContext { node: None }
+    }
+
     fn create_node(
         &self,
         parent: Option<&Rc<Node>>,
@@ -190,7 +194,7 @@ impl XmlState {
             top.handler
                 .start_element(Some(&top.handler.get_node()), handle, name, pbag)
         } else {
-            let default_context = NodeCreationContext { node: None };
+            let default_context = NodeCreationContext::empty();
 
             default_context.start_element(None, handle, name, pbag)
         };


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