[librsvg] Don't use "extern crate"; import macros directly



commit 4332694fb62ae5b43c0efb2db1aab65eb796ab16
Author: Federico Mena Quintero <federico gnome org>
Date:   Mon Jun 3 17:35:35 2019 -0500

    Don't use "extern crate"; import macros directly

 rsvg_internals/src/c_api.rs                      |  7 ++++++-
 rsvg_internals/src/clip_path.rs                  |  1 +
 rsvg_internals/src/create_node.rs                |  3 ++-
 rsvg_internals/src/filters/blend.rs              |  2 +-
 rsvg_internals/src/filters/color_matrix.rs       |  2 +-
 rsvg_internals/src/filters/component_transfer.rs |  2 +-
 rsvg_internals/src/filters/composite.rs          |  1 +
 rsvg_internals/src/filters/convolve_matrix.rs    |  2 +-
 rsvg_internals/src/filters/displacement_map.rs   |  2 +-
 rsvg_internals/src/filters/gaussian_blur.rs      |  1 +
 rsvg_internals/src/filters/image.rs              |  1 +
 rsvg_internals/src/filters/light/light_source.rs |  1 +
 rsvg_internals/src/filters/light/lighting.rs     |  1 +
 rsvg_internals/src/filters/merge.rs              |  1 +
 rsvg_internals/src/filters/mod.rs                |  1 +
 rsvg_internals/src/filters/morphology.rs         |  2 +-
 rsvg_internals/src/filters/node.rs               |  1 +
 rsvg_internals/src/filters/offset.rs             |  4 ++--
 rsvg_internals/src/filters/turbulence.rs         |  2 +-
 rsvg_internals/src/gradient.rs                   |  1 +
 rsvg_internals/src/image.rs                      |  1 +
 rsvg_internals/src/lib.rs                        | 13 -------------
 rsvg_internals/src/link.rs                       |  2 ++
 rsvg_internals/src/log.rs                        |  2 ++
 rsvg_internals/src/marker.rs                     |  1 +
 rsvg_internals/src/mask.rs                       |  1 +
 rsvg_internals/src/node.rs                       |  5 +++--
 rsvg_internals/src/pattern.rs                    |  1 +
 rsvg_internals/src/properties.rs                 |  2 +-
 rsvg_internals/src/property_bag.rs               |  1 +
 rsvg_internals/src/shapes.rs                     |  1 +
 rsvg_internals/src/stop.rs                       |  1 +
 rsvg_internals/src/structure.rs                  |  1 +
 rsvg_internals/src/style.rs                      |  2 ++
 rsvg_internals/src/text.rs                       |  1 +
 rsvg_internals/src/xml.rs                        |  2 +-
 36 files changed, 47 insertions(+), 28 deletions(-)
---
diff --git a/rsvg_internals/src/c_api.rs b/rsvg_internals/src/c_api.rs
index 0e8ff856..13ad19fb 100644
--- a/rsvg_internals/src/c_api.rs
+++ b/rsvg_internals/src/c_api.rs
@@ -11,6 +11,8 @@ use gdk_pixbuf::Pixbuf;
 use libc;
 use url::Url;
 
+use bitflags::bitflags;
+
 use gio::prelude::*;
 
 use glib::object::ObjectClass;
@@ -19,7 +21,10 @@ use glib::subclass::object::ObjectClassSubclassExt;
 use glib::subclass::prelude::*;
 use glib::translate::*;
 use glib::value::{FromValue, FromValueOptional, SetValue};
-use glib::{Bytes, Cast, ParamFlags, ParamSpec, StaticType, ToValue, Type, Value};
+use glib::{
+    glib_object_impl, glib_object_subclass, Bytes, Cast, ParamFlags, ParamSpec, StaticType,
+    ToValue, Type, Value,
+};
 
 use glib_sys;
 use gobject_sys::{self, GEnumValue, GFlagsValue};
diff --git a/rsvg_internals/src/clip_path.rs b/rsvg_internals/src/clip_path.rs
index 9a97d18c..385e37b1 100644
--- a/rsvg_internals/src/clip_path.rs
+++ b/rsvg_internals/src/clip_path.rs
@@ -1,6 +1,7 @@
 use std::cell::Cell;
 
 use cairo::{self, MatrixTrait};
+use markup5ever::local_name;
 
 use crate::bbox::BoundingBox;
 use crate::coord_units::CoordUnits;
diff --git a/rsvg_internals/src/create_node.rs b/rsvg_internals/src/create_node.rs
index 4d924959..b6deb6dc 100644
--- a/rsvg_internals/src/create_node.rs
+++ b/rsvg_internals/src/create_node.rs
@@ -1,4 +1,5 @@
-use markup5ever::LocalName;
+use lazy_static::lazy_static;
+use markup5ever::{local_name, LocalName};
 use std::collections::HashMap;
 
 use crate::clip_path::NodeClipPath;
diff --git a/rsvg_internals/src/filters/blend.rs b/rsvg_internals/src/filters/blend.rs
index 9dd2f7db..92361e0b 100644
--- a/rsvg_internals/src/filters/blend.rs
+++ b/rsvg_internals/src/filters/blend.rs
@@ -1,7 +1,7 @@
 use std::cell::{Cell, RefCell};
 
 use cairo;
-use markup5ever::LocalName;
+use markup5ever::{local_name, LocalName};
 
 use crate::drawing_ctx::DrawingCtx;
 use crate::error::NodeError;
diff --git a/rsvg_internals/src/filters/color_matrix.rs b/rsvg_internals/src/filters/color_matrix.rs
index 8963fc7a..3f2920c3 100644
--- a/rsvg_internals/src/filters/color_matrix.rs
+++ b/rsvg_internals/src/filters/color_matrix.rs
@@ -1,7 +1,7 @@
 use std::cell::RefCell;
 
 use cairo::{self, ImageSurface};
-use markup5ever::LocalName;
+use markup5ever::{local_name, LocalName};
 use nalgebra::{Matrix3, Matrix4x5, Matrix5, Vector5};
 
 use crate::drawing_ctx::DrawingCtx;
diff --git a/rsvg_internals/src/filters/component_transfer.rs 
b/rsvg_internals/src/filters/component_transfer.rs
index eb9634ac..9351663b 100644
--- a/rsvg_internals/src/filters/component_transfer.rs
+++ b/rsvg_internals/src/filters/component_transfer.rs
@@ -2,7 +2,7 @@ use std::cell::{Cell, Ref, RefCell};
 use std::cmp::min;
 
 use cairo::{self, ImageSurface};
-use markup5ever::LocalName;
+use markup5ever::{local_name, LocalName};
 
 use crate::drawing_ctx::DrawingCtx;
 use crate::error::NodeError;
diff --git a/rsvg_internals/src/filters/composite.rs b/rsvg_internals/src/filters/composite.rs
index 959f3ba8..73c6c4a1 100644
--- a/rsvg_internals/src/filters/composite.rs
+++ b/rsvg_internals/src/filters/composite.rs
@@ -2,6 +2,7 @@ use std::cell::{Cell, RefCell};
 
 use cairo::{self, ImageSurface};
 use cssparser::{CowRcStr, Parser, Token};
+use markup5ever::local_name;
 
 use crate::drawing_ctx::DrawingCtx;
 use crate::error::{NodeError, ValueErrorKind};
diff --git a/rsvg_internals/src/filters/convolve_matrix.rs b/rsvg_internals/src/filters/convolve_matrix.rs
index 1b56bd0c..e1fa4bcb 100644
--- a/rsvg_internals/src/filters/convolve_matrix.rs
+++ b/rsvg_internals/src/filters/convolve_matrix.rs
@@ -1,7 +1,7 @@
 use std::cell::{Cell, RefCell};
 
 use cairo::{self, ImageSurface, MatrixTrait};
-use markup5ever::LocalName;
+use markup5ever::{local_name, LocalName};
 use nalgebra::{DMatrix, Dynamic, VecStorage};
 
 use crate::drawing_ctx::DrawingCtx;
diff --git a/rsvg_internals/src/filters/displacement_map.rs b/rsvg_internals/src/filters/displacement_map.rs
index 0faacd1c..60c72385 100644
--- a/rsvg_internals/src/filters/displacement_map.rs
+++ b/rsvg_internals/src/filters/displacement_map.rs
@@ -1,7 +1,7 @@
 use std::cell::{Cell, RefCell};
 
 use cairo::{self, ImageSurface, MatrixTrait};
-use markup5ever::LocalName;
+use markup5ever::{local_name, LocalName};
 
 use crate::drawing_ctx::DrawingCtx;
 use crate::error::NodeError;
diff --git a/rsvg_internals/src/filters/gaussian_blur.rs b/rsvg_internals/src/filters/gaussian_blur.rs
index 84866763..e41ea7a1 100644
--- a/rsvg_internals/src/filters/gaussian_blur.rs
+++ b/rsvg_internals/src/filters/gaussian_blur.rs
@@ -3,6 +3,7 @@ use std::cmp::min;
 use std::f64;
 
 use cairo::MatrixTrait;
+use markup5ever::local_name;
 use nalgebra::{DMatrix, Dynamic, VecStorage};
 
 use crate::drawing_ctx::DrawingCtx;
diff --git a/rsvg_internals/src/filters/image.rs b/rsvg_internals/src/filters/image.rs
index fd1b9e5f..dc21a943 100644
--- a/rsvg_internals/src/filters/image.rs
+++ b/rsvg_internals/src/filters/image.rs
@@ -1,6 +1,7 @@
 use std::cell::{Cell, RefCell};
 
 use cairo::{self, ImageSurface, MatrixTrait, PatternTrait, Rectangle};
+use markup5ever::local_name;
 
 use crate::allowed_url::{Fragment, Href};
 use crate::aspect_ratio::AspectRatio;
diff --git a/rsvg_internals/src/filters/light/light_source.rs 
b/rsvg_internals/src/filters/light/light_source.rs
index 336a8f03..7cd75cd0 100644
--- a/rsvg_internals/src/filters/light/light_source.rs
+++ b/rsvg_internals/src/filters/light/light_source.rs
@@ -2,6 +2,7 @@ use std::cell::Cell;
 
 use cairo::MatrixTrait;
 use cssparser;
+use markup5ever::local_name;
 use nalgebra::Vector3;
 
 use crate::error::NodeError;
diff --git a/rsvg_internals/src/filters/light/lighting.rs b/rsvg_internals/src/filters/light/lighting.rs
index 345bb16d..bc8fc88a 100644
--- a/rsvg_internals/src/filters/light/lighting.rs
+++ b/rsvg_internals/src/filters/light/lighting.rs
@@ -3,6 +3,7 @@ use std::cmp::max;
 
 use cairo::{self, ImageSurface, MatrixTrait};
 use cssparser;
+use markup5ever::local_name;
 use nalgebra::Vector3;
 use num_traits::identities::Zero;
 use rayon::prelude::*;
diff --git a/rsvg_internals/src/filters/merge.rs b/rsvg_internals/src/filters/merge.rs
index ab287783..45d5824b 100644
--- a/rsvg_internals/src/filters/merge.rs
+++ b/rsvg_internals/src/filters/merge.rs
@@ -1,6 +1,7 @@
 use std::cell::RefCell;
 
 use cairo::{self, ImageSurface};
+use markup5ever::local_name;
 
 use crate::drawing_ctx::DrawingCtx;
 use crate::node::{NodeResult, NodeTrait, NodeType, RsvgNode};
diff --git a/rsvg_internals/src/filters/mod.rs b/rsvg_internals/src/filters/mod.rs
index b80f4396..0b9a2e40 100644
--- a/rsvg_internals/src/filters/mod.rs
+++ b/rsvg_internals/src/filters/mod.rs
@@ -3,6 +3,7 @@ use std::ops::Deref;
 use std::time::Instant;
 
 use cairo::{self, MatrixTrait};
+use markup5ever::local_name;
 
 use crate::bbox::BoundingBox;
 use crate::coord_units::CoordUnits;
diff --git a/rsvg_internals/src/filters/morphology.rs b/rsvg_internals/src/filters/morphology.rs
index ed13a0dd..6d7dd87e 100644
--- a/rsvg_internals/src/filters/morphology.rs
+++ b/rsvg_internals/src/filters/morphology.rs
@@ -2,7 +2,7 @@ use std::cell::Cell;
 use std::cmp::{max, min};
 
 use cairo::{self, ImageSurface, MatrixTrait};
-use markup5ever::LocalName;
+use markup5ever::{local_name, LocalName};
 
 use crate::drawing_ctx::DrawingCtx;
 use crate::error::NodeError;
diff --git a/rsvg_internals/src/filters/node.rs b/rsvg_internals/src/filters/node.rs
index ac3f30a1..a3147a59 100644
--- a/rsvg_internals/src/filters/node.rs
+++ b/rsvg_internals/src/filters/node.rs
@@ -2,6 +2,7 @@
 use std::cell::Cell;
 
 use cairo::{self, MatrixTrait};
+use markup5ever::local_name;
 
 use crate::bbox::BoundingBox;
 use crate::coord_units::CoordUnits;
diff --git a/rsvg_internals/src/filters/offset.rs b/rsvg_internals/src/filters/offset.rs
index 681af12f..cef0e7e7 100644
--- a/rsvg_internals/src/filters/offset.rs
+++ b/rsvg_internals/src/filters/offset.rs
@@ -1,6 +1,6 @@
-use std::cell::Cell;
-
+use markup5ever::local_name;
 use cairo::{self, ImageSurface, MatrixTrait};
+use std::cell::Cell;
 
 use crate::drawing_ctx::DrawingCtx;
 use crate::error::NodeError;
diff --git a/rsvg_internals/src/filters/turbulence.rs b/rsvg_internals/src/filters/turbulence.rs
index 3e608dc8..14e91ea7 100644
--- a/rsvg_internals/src/filters/turbulence.rs
+++ b/rsvg_internals/src/filters/turbulence.rs
@@ -1,7 +1,7 @@
 use std::cell::Cell;
 
 use cairo::{self, ImageSurface, MatrixTrait};
-use markup5ever::LocalName;
+use markup5ever::{local_name, LocalName};
 
 use crate::drawing_ctx::DrawingCtx;
 use crate::error::NodeError;
diff --git a/rsvg_internals/src/gradient.rs b/rsvg_internals/src/gradient.rs
index 4aa2616a..f0e01567 100644
--- a/rsvg_internals/src/gradient.rs
+++ b/rsvg_internals/src/gradient.rs
@@ -1,5 +1,6 @@
 use cairo::{self, MatrixTrait};
 use cssparser::{self, CowRcStr, Parser, Token};
+use markup5ever::local_name;
 
 use std::cell::RefCell;
 
diff --git a/rsvg_internals/src/image.rs b/rsvg_internals/src/image.rs
index fab5c2c6..7c57e3c9 100644
--- a/rsvg_internals/src/image.rs
+++ b/rsvg_internals/src/image.rs
@@ -1,5 +1,6 @@
 use cairo;
 use cairo::{PatternTrait, Rectangle};
+use markup5ever::local_name;
 use std::cell::{Cell, RefCell};
 
 use crate::allowed_url::Href;
diff --git a/rsvg_internals/src/lib.rs b/rsvg_internals/src/lib.rs
index c18b9bc0..dd0e4e56 100644
--- a/rsvg_internals/src/lib.rs
+++ b/rsvg_internals/src/lib.rs
@@ -5,19 +5,6 @@
 
 use ::xml as xml_rs;
 
-#[macro_use]
-extern crate bitflags;
-
-#[macro_use]
-extern crate glib;
-
-#[macro_use]
-extern crate lazy_static;
-
-// This provides the LocalName struct and local_name! macro
-#[macro_use]
-extern crate markup5ever;
-
 pub use crate::c_api::{
     rsvg_rust_error_get_type,
     rsvg_rust_handle_close,
diff --git a/rsvg_internals/src/link.rs b/rsvg_internals/src/link.rs
index 2e27f830..23e689ad 100644
--- a/rsvg_internals/src/link.rs
+++ b/rsvg_internals/src/link.rs
@@ -1,3 +1,5 @@
+use lazy_static::lazy_static;
+use markup5ever::local_name;
 use regex::{Captures, Regex};
 use std::borrow::Cow;
 use std::cell::RefCell;
diff --git a/rsvg_internals/src/log.rs b/rsvg_internals/src/log.rs
index 32807a36..2d3e059d 100644
--- a/rsvg_internals/src/log.rs
+++ b/rsvg_internals/src/log.rs
@@ -1,3 +1,5 @@
+use lazy_static::lazy_static;
+
 #[macro_export]
 macro_rules! rsvg_log {
     (
diff --git a/rsvg_internals/src/marker.rs b/rsvg_internals/src/marker.rs
index fbdf5f27..4c6c67ae 100644
--- a/rsvg_internals/src/marker.rs
+++ b/rsvg_internals/src/marker.rs
@@ -3,6 +3,7 @@ use std::f64::consts::*;
 use std::ops::Deref;
 
 use cairo::{MatrixTrait, Rectangle};
+use markup5ever::local_name;
 use cssparser::{CowRcStr, Parser, Token};
 
 use crate::allowed_url::Fragment;
diff --git a/rsvg_internals/src/mask.rs b/rsvg_internals/src/mask.rs
index 4fa59490..8718bf66 100644
--- a/rsvg_internals/src/mask.rs
+++ b/rsvg_internals/src/mask.rs
@@ -1,4 +1,5 @@
 use cairo::{self, MatrixTrait};
+use markup5ever::local_name;
 use std::cell::Cell;
 
 use crate::bbox::BoundingBox;
diff --git a/rsvg_internals/src/node.rs b/rsvg_internals/src/node.rs
index 3550e5ef..908f2701 100644
--- a/rsvg_internals/src/node.rs
+++ b/rsvg_internals/src/node.rs
@@ -1,6 +1,6 @@
 use cairo::{Matrix, MatrixTrait};
 use downcast_rs::*;
-use markup5ever::LocalName;
+use markup5ever::{local_name, LocalName};
 use std::cell::{Cell, Ref, RefCell};
 use std::collections::HashSet;
 use std::fmt;
@@ -87,7 +87,8 @@ impl NodeData {
         }
 
         let mut specified_values = self.specified_values.borrow_mut();
-        self.node_impl.set_overridden_properties(&mut specified_values);
+        self.node_impl
+            .set_overridden_properties(&mut specified_values);
     }
 
     fn save_style_attribute(&self, pbag: &PropertyBag<'_>) {
diff --git a/rsvg_internals/src/pattern.rs b/rsvg_internals/src/pattern.rs
index 7723e31b..e62d04f1 100644
--- a/rsvg_internals/src/pattern.rs
+++ b/rsvg_internals/src/pattern.rs
@@ -1,5 +1,6 @@
 use cairo;
 use cairo::{MatrixTrait, PatternTrait};
+use markup5ever::local_name;
 use std::cell::RefCell;
 use std::f64;
 
diff --git a/rsvg_internals/src/properties.rs b/rsvg_internals/src/properties.rs
index 2ec16719..4e693756 100644
--- a/rsvg_internals/src/properties.rs
+++ b/rsvg_internals/src/properties.rs
@@ -1,5 +1,5 @@
 use cssparser::{self, DeclarationListParser, Parser, ParserInput};
-use markup5ever::LocalName;
+use markup5ever::{local_name, LocalName};
 use std::collections::HashSet;
 
 use crate::css::{DeclParser, Declaration};
diff --git a/rsvg_internals/src/property_bag.rs b/rsvg_internals/src/property_bag.rs
index c92cbdd1..c0713b59 100644
--- a/rsvg_internals/src/property_bag.rs
+++ b/rsvg_internals/src/property_bag.rs
@@ -89,6 +89,7 @@ impl<'a> Iterator for PropertyBagIter<'a> {
 
 #[cfg(test)]
 mod tests {
+    use markup5ever::local_name;
     use super::*;
     use std::ffi::CString;
     use std::ptr;
diff --git a/rsvg_internals/src/shapes.rs b/rsvg_internals/src/shapes.rs
index 439ef76d..1c3b894f 100644
--- a/rsvg_internals/src/shapes.rs
+++ b/rsvg_internals/src/shapes.rs
@@ -1,4 +1,5 @@
 use cairo;
+use markup5ever::local_name;
 use std::cell::Cell;
 use std::cell::RefCell;
 use std::ops::Deref;
diff --git a/rsvg_internals/src/stop.rs b/rsvg_internals/src/stop.rs
index 4274075d..5f728dff 100644
--- a/rsvg_internals/src/stop.rs
+++ b/rsvg_internals/src/stop.rs
@@ -1,3 +1,4 @@
+use markup5ever::local_name;
 use std::cell::Cell;
 
 use crate::error::*;
diff --git a/rsvg_internals/src/structure.rs b/rsvg_internals/src/structure.rs
index 34ade742..9cc68e1d 100644
--- a/rsvg_internals/src/structure.rs
+++ b/rsvg_internals/src/structure.rs
@@ -2,6 +2,7 @@ use std::cell::Cell;
 use std::cell::RefCell;
 
 use cairo::Rectangle;
+use markup5ever::local_name;
 
 use crate::allowed_url::Fragment;
 use crate::aspect_ratio::*;
diff --git a/rsvg_internals/src/style.rs b/rsvg_internals/src/style.rs
index baf2c2b4..9bdacf02 100644
--- a/rsvg_internals/src/style.rs
+++ b/rsvg_internals/src/style.rs
@@ -1,3 +1,5 @@
+use markup5ever::local_name;
+
 use crate::node::{NodeResult, NodeTrait, NodeType, RsvgNode};
 use crate::property_bag::PropertyBag;
 use crate::text::NodeChars;
diff --git a/rsvg_internals/src/text.rs b/rsvg_internals/src/text.rs
index c26f434b..e1d01cd8 100644
--- a/rsvg_internals/src/text.rs
+++ b/rsvg_internals/src/text.rs
@@ -1,4 +1,5 @@
 use glib::translate::*;
+use markup5ever::local_name;
 use pango::{self, ContextExt, FontMapExt, LayoutExt};
 use pango_sys;
 use pangocairo;
diff --git a/rsvg_internals/src/xml.rs b/rsvg_internals/src/xml.rs
index e93d2ebc..ccd730a9 100644
--- a/rsvg_internals/src/xml.rs
+++ b/rsvg_internals/src/xml.rs
@@ -3,7 +3,7 @@ use encoding::label::encoding_from_whatwg_label;
 use encoding::DecoderTrap;
 use glib::IsA;
 use libc;
-use markup5ever::LocalName;
+use markup5ever::{local_name, LocalName};
 use std::collections::HashMap;
 use std::str;
 


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