[librsvg/librsvg-2.46] path_builder: use is_empty



commit 3880f77e8552816c15e3838c68873dde41b94e4a
Author: Paolo Borelli <pborelli gnome org>
Date:   Sun Oct 13 12:12:52 2019 +0200

    path_builder: use is_empty

 rsvg_internals/src/path_builder.rs | 10 +++++-----
 rsvg_internals/src/shapes.rs       |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/rsvg_internals/src/path_builder.rs b/rsvg_internals/src/path_builder.rs
index 28ad9110..62218195 100644
--- a/rsvg_internals/src/path_builder.rs
+++ b/rsvg_internals/src/path_builder.rs
@@ -355,8 +355,12 @@ impl PathBuilder {
         &self.path_commands
     }
 
+    pub fn is_empty(&self) -> bool {
+        self.path_commands.is_empty()
+    }
+
     pub fn to_cairo(&self, cr: &cairo::Context) -> Result<(), cairo::Status> {
-        assert!(!self.empty());
+        assert!(!self.is_empty());
 
         for s in &self.path_commands {
             s.to_cairo(cr);
@@ -378,10 +382,6 @@ impl PathBuilder {
             Err(status)
         }
     }
-
-    pub fn empty(&self) -> bool {
-        self.path_commands.len() == 0
-    }
 }
 
 #[cfg(test)]
diff --git a/rsvg_internals/src/shapes.rs b/rsvg_internals/src/shapes.rs
index 0e475efe..8425b5dd 100644
--- a/rsvg_internals/src/shapes.rs
+++ b/rsvg_internals/src/shapes.rs
@@ -23,7 +23,7 @@ fn render_path_builder(
     render_markers: bool,
     clipping: bool,
 ) -> Result<BoundingBox, RenderingError> {
-    if !builder.empty() {
+    if !builder.is_empty() {
         let bbox = draw_ctx.with_discrete_layer(node, values, clipping, &mut |dc| {
             let cr = dc.get_cairo_context();
 


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