[librsvg] Fix some compiler warnings



commit 6f3b8b8c056507ea11728ed0999c9609e549ea6a
Author: Federico Mena Quintero <federico gnome org>
Date:   Wed Nov 22 09:37:49 2017 -0600

    Fix some compiler warnings

 rust/src/error.rs     |    2 ++
 rust/src/marker.rs    |    2 --
 rust/src/parsers.rs   |    2 +-
 rust/src/structure.rs |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/rust/src/error.rs b/rust/src/error.rs
index 8f8e9cf..f3b7eb4 100644
--- a/rust/src/error.rs
+++ b/rust/src/error.rs
@@ -72,6 +72,7 @@ impl From<ParseError> for AttributeError {
     }
 }
 
+#[cfg(test)]
 pub fn is_parse_error<T> (r: &Result<T, AttributeError>) -> bool {
     match *r {
         Err (AttributeError::Parse (_)) => true,
@@ -79,6 +80,7 @@ pub fn is_parse_error<T> (r: &Result<T, AttributeError>) -> bool {
     }
 }
 
+#[cfg(test)]
 pub fn is_value_error<T> (r: &Result<T, AttributeError>) -> bool {
     match *r {
         Err (AttributeError::Value (_)) => true,
diff --git a/rust/src/marker.rs b/rust/src/marker.rs
index 3de8d5a..092b076 100644
--- a/rust/src/marker.rs
+++ b/rust/src/marker.rs
@@ -1,4 +1,3 @@
-use ::cairo;
 use ::glib::translate::*;
 use ::libc;
 
@@ -22,7 +21,6 @@ use property_bag;
 use property_bag::*;
 use util::*;
 use viewbox::*;
-use viewport::draw_in_viewport;
 
 // markerUnits attribute: https://www.w3.org/TR/SVG/painting.html#MarkerElement
 
diff --git a/rust/src/parsers.rs b/rust/src/parsers.rs
index 4130a50..27067d1 100644
--- a/rust/src/parsers.rs
+++ b/rust/src/parsers.rs
@@ -246,7 +246,7 @@ pub extern fn rsvg_css_parse_number_list (in_str:   *const libc::c_char,
                     as *mut libc::c_double
             };
 
-            let mut array = unsafe { slice::from_raw_parts_mut (c_array, num_elems) };
+            let array = unsafe { slice::from_raw_parts_mut (c_array, num_elems) };
 
             array.copy_from_slice (&number_list);
 
diff --git a/rust/src/structure.rs b/rust/src/structure.rs
index e5e07d6..507a2a5 100644
--- a/rust/src/structure.rs
+++ b/rust/src/structure.rs
@@ -166,7 +166,7 @@ impl NodeTrait for NodeSvg {
         Ok (())
     }
 
-    fn draw (&self, node: &RsvgNode, draw_ctx: *const RsvgDrawingCtx, dominate: i32) {
+    fn draw (&self, node: &RsvgNode, draw_ctx: *const RsvgDrawingCtx, _dominate: i32) {
         let nx = self.x.get ().normalize (draw_ctx);
         let ny = self.y.get ().normalize (draw_ctx);
         let nw = self.w.get ().normalize (draw_ctx);


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