[librsvg] *.rs - get rid of unused imports
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] *.rs - get rid of unused imports
- Date: Fri, 2 Jun 2017 16:50:40 +0000 (UTC)
commit 48f986a583f4a4d42c9db26c083c92ddf1f55cc2
Author: Federico Mena Quintero <federico gnome org>
Date: Fri Jun 2 11:49:27 2017 -0500
*.rs - get rid of unused imports
rust/src/aspect_ratio.rs | 6 ++----
rust/src/bbox.rs | 6 +++---
rust/src/drawing_ctx.rs | 12 +++++-------
rust/src/gradient.rs | 11 ++++-------
rust/src/length.rs | 10 ++++------
rust/src/lib.rs | 16 ++++++++--------
rust/src/marker.rs | 11 ++++-------
rust/src/node.rs | 19 ++++++-------------
rust/src/parsers.rs | 3 +--
rust/src/path_builder.rs | 17 +++++++++--------
rust/src/path_parser.rs | 2 --
rust/src/pattern.rs | 19 ++++++++-----------
rust/src/property_bag.rs | 10 +++-------
rust/src/shapes.rs | 3 ++-
rust/src/structure.rs | 11 +++--------
rust/src/transform.rs | 14 ++++++--------
rust/src/viewbox.rs | 6 +++---
17 files changed, 71 insertions(+), 105 deletions(-)
---
diff --git a/rust/src/aspect_ratio.rs b/rust/src/aspect_ratio.rs
index 7e492f1..9925d04 100644
--- a/rust/src/aspect_ratio.rs
+++ b/rust/src/aspect_ratio.rs
@@ -15,10 +15,8 @@
//! [`AspectRatio`]: struct.AspectRatio.html
//! [spec]: https://www.w3.org/TR/SVG/coords.html#PreserveAspectRatioAttribute
-extern crate libc;
-extern crate glib;
-
-use self::glib::translate::*;
+use ::libc;
+use ::glib::translate::*;
use std::str::FromStr;
diff --git a/rust/src/bbox.rs b/rust/src/bbox.rs
index cc5dccb..eb9931f 100644
--- a/rust/src/bbox.rs
+++ b/rust/src/bbox.rs
@@ -1,6 +1,6 @@
-extern crate cairo;
-extern crate glib_sys;
-extern crate glib;
+use ::cairo;
+use ::glib_sys;
+use ::glib;
use self::cairo::MatrixTrait;
use self::glib::translate::*;
diff --git a/rust/src/drawing_ctx.rs b/rust/src/drawing_ctx.rs
index 0e8e8ad..ed8fe34 100644
--- a/rust/src/drawing_ctx.rs
+++ b/rust/src/drawing_ctx.rs
@@ -1,10 +1,8 @@
-extern crate glib_sys;
-extern crate glib;
-extern crate cairo;
-extern crate cairo_sys;
-extern crate libc;
-
-use self::glib::translate::*;
+use ::cairo;
+use ::cairo_sys;
+use ::glib_sys;
+use ::glib::translate::*;
+use ::libc;
use color::*;
use error::*;
diff --git a/rust/src/gradient.rs b/rust/src/gradient.rs
index 102dc0f..26789da 100644
--- a/rust/src/gradient.rs
+++ b/rust/src/gradient.rs
@@ -1,10 +1,7 @@
-extern crate libc;
-extern crate cairo;
-extern crate cairo_sys;
-extern crate glib_sys;
-extern crate glib;
-
-use self::glib::translate::*;
+use ::cairo;
+use ::glib_sys;
+use ::glib::translate::*;
+use ::libc;
use bbox::*;
use drawing_ctx;
diff --git a/rust/src/length.rs b/rust/src/length.rs
index 80ba16b..c0563ce 100644
--- a/rust/src/length.rs
+++ b/rust/src/length.rs
@@ -1,9 +1,7 @@
-extern crate libc;
-extern crate glib;
+use ::glib::translate::*;
+use ::libc;
-use std::f64;
-
-use self::glib::translate::*;
+use std::f64::consts::*;
use drawing_ctx;
use drawing_ctx::RsvgDrawingCtx;
@@ -242,7 +240,7 @@ fn viewport_percentage (x: f64, y: f64) -> f64 {
* percentage is calculated as the specified percentage of
* sqrt((actual-width)**2 + (actual-height)**2))/sqrt(2)."
*/
- return (x * x + y * y).sqrt () / f64::consts::SQRT_2;
+ return (x * x + y * y).sqrt () / SQRT_2;
}
#[no_mangle]
diff --git a/rust/src/lib.rs b/rust/src/lib.rs
index 01e70b1..db675c7 100644
--- a/rust/src/lib.rs
+++ b/rust/src/lib.rs
@@ -1,17 +1,17 @@
-extern crate libc;
-extern crate glib;
extern crate cairo;
+extern crate cairo_sys;
+extern crate cssparser;
+extern crate glib;
+extern crate glib_sys;
+extern crate lalrpop_util;
+extern crate libc;
#[macro_use]
extern crate bitflags;
-
-#[macro_use]
-extern crate nom;
-
#[macro_use]
extern crate downcast_rs;
-
-extern crate cssparser;
+#[macro_use]
+extern crate nom;
pub use aspect_ratio::{
rsvg_aspect_ratio_parse,
diff --git a/rust/src/marker.rs b/rust/src/marker.rs
index 728208f..9b88409 100644
--- a/rust/src/marker.rs
+++ b/rust/src/marker.rs
@@ -1,10 +1,7 @@
-extern crate glib;
-extern crate libc;
-extern crate cairo;
-extern crate cairo_sys;
-
-use self::glib::translate::*;
-use self::cairo::MatrixTrait;
+use ::cairo;
+use ::cairo::MatrixTrait;
+use ::glib::translate::*;
+use ::libc;
use std::cell::Cell;
use std::f64::consts::*;
diff --git a/rust/src/node.rs b/rust/src/node.rs
index 8d7a5fc..b4b4b44 100644
--- a/rust/src/node.rs
+++ b/rust/src/node.rs
@@ -1,28 +1,21 @@
-extern crate libc;
-extern crate glib_sys;
-extern crate glib;
+use ::downcast_rs::*;
+use ::glib_sys;
+use ::glib::translate::*;
+use ::libc;
use std::rc::Rc;
use std::rc::Weak;
use std::cell::RefCell;
use std::ptr;
-use downcast_rs::*;
-
use drawing_ctx::RsvgDrawingCtx;
use drawing_ctx;
-
+use error::*;
use handle::RsvgHandle;
-
+use parsers::ParseError;
use property_bag::RsvgPropertyBag;
-
use state::RsvgState;
-use error::*;
-use parsers::ParseError;
-
-use self::glib::translate::*;
-
/* A *const RsvgNode is just a pointer for the C code's benefit: it
* points to an Rc<Node>, which is our refcounted Rust representation
* of nodes.
diff --git a/rust/src/parsers.rs b/rust/src/parsers.rs
index 3965db4..e56effe 100644
--- a/rust/src/parsers.rs
+++ b/rust/src/parsers.rs
@@ -1,6 +1,5 @@
-extern crate cairo;
+use ::nom::{IResult, double, is_alphabetic};
-use nom::{IResult, double, is_alphabetic};
use std::str;
use std::f64::consts::*;
diff --git a/rust/src/path_builder.rs b/rust/src/path_builder.rs
index 0f0e23c..55993bd 100644
--- a/rust/src/path_builder.rs
+++ b/rust/src/path_builder.rs
@@ -1,7 +1,8 @@
-use std::f64;
+use ::cairo;
+use ::cairo_sys;
-extern crate cairo;
-extern crate cairo_sys;
+use std::f64;
+use std::f64::consts::*;
#[repr(C)]
pub struct RsvgPathBuilder {
@@ -79,7 +80,7 @@ impl RsvgPathBuilder {
}
/* X-axis */
- f = x_axis_rotation * f64::consts::PI / 180.0;
+ f = x_axis_rotation * PI / 180.0;
sinf = f.sin ();
cosf = f.cos ();
@@ -157,14 +158,14 @@ impl RsvgPathBuilder {
}
if is_sweep && delta_theta < 0.0 {
- delta_theta += f64::consts::PI * 2.0;
+ delta_theta += PI * 2.0;
} else if !is_sweep && delta_theta > 0.0 {
- delta_theta -= f64::consts::PI * 2.0;
+ delta_theta -= PI * 2.0;
}
/* Now draw the arc */
- n_segs = (delta_theta / (f64::consts::PI * 0.5 + 0.001)).abs ().ceil () as i32;
+ n_segs = (delta_theta / (PI * 0.5 + 0.001)).abs ().ceil () as i32;
let n_segs_dbl = n_segs as f64;
for i in 0 .. n_segs {
@@ -193,7 +194,7 @@ impl RsvgPathBuilder {
let sinf: f64;
let cosf: f64;
- f = x_axis_rotation * f64::consts::PI / 180.0;
+ f = x_axis_rotation * PI / 180.0;
sinf = f.sin ();
cosf = f.cos ();
diff --git a/rust/src/path_parser.rs b/rust/src/path_parser.rs
index 06273a5..27c40a3 100644
--- a/rust/src/path_parser.rs
+++ b/rust/src/path_parser.rs
@@ -6,8 +6,6 @@ use std::str::Chars;
use std::iter::Enumerate;
use path_builder::*;
-use self::glib::translate::*;
-
extern crate cairo;
struct PathParser<'external> {
diff --git a/rust/src/pattern.rs b/rust/src/pattern.rs
index bbea49d..9cba565 100644
--- a/rust/src/pattern.rs
+++ b/rust/src/pattern.rs
@@ -1,13 +1,15 @@
-extern crate libc;
-extern crate cairo;
-extern crate cairo_sys;
-extern crate glib_sys;
-extern crate glib;
+use ::cairo;
+use ::cairo::MatrixTrait;
+use ::cairo::enums::*;
+use ::cairo::SurfacePattern;
+use ::cairo::Pattern as CairoPattern;
+use ::glib_sys;
+use ::glib::translate::*;
+use ::libc;
use std::cell::RefCell;
use std::rc::*;
use std::str::FromStr;
-use self::glib::translate::*;
use aspect_ratio::*;
use bbox::*;
@@ -23,11 +25,6 @@ use property_bag::*;
use util::*;
use viewbox::*;
-use self::cairo::MatrixTrait;
-use self::cairo::enums::*;
-use self::cairo::SurfacePattern;
-use self::cairo::Pattern as CairoPattern;
-
#[derive(Clone)]
pub struct Pattern {
pub units: Option<PaintServerUnits>,
diff --git a/rust/src/property_bag.rs b/rust/src/property_bag.rs
index 4fa07a1..f334388 100644
--- a/rust/src/property_bag.rs
+++ b/rust/src/property_bag.rs
@@ -1,15 +1,11 @@
-extern crate libc;
-extern crate glib;
+use ::cairo;
+use ::glib::translate::*;
+use ::libc;
use std::str::FromStr;
-use self::glib::translate::*;
-use ::cairo;
-use ::cairo::MatrixTrait;
-
use error::*;
use length::*;
-use parsers::ParseError;
use transform::*;
pub enum RsvgPropertyBag {}
diff --git a/rust/src/shapes.rs b/rust/src/shapes.rs
index e960f20..cb4e645 100644
--- a/rust/src/shapes.rs
+++ b/rust/src/shapes.rs
@@ -1,6 +1,7 @@
+use ::libc;
+
use std::cell::RefCell;
use std::cell::Cell;
-extern crate libc;
use drawing_ctx;
use drawing_ctx::*;
diff --git a/rust/src/structure.rs b/rust/src/structure.rs
index c891941..e54d786 100644
--- a/rust/src/structure.rs
+++ b/rust/src/structure.rs
@@ -1,8 +1,6 @@
-extern crate glib;
-extern crate cairo;
-extern crate libc;
-
-use self::glib::translate::*;
+use ::cairo::MatrixTrait;
+use ::glib::translate::*;
+use ::libc;
use std::cell::RefCell;
use std::cell::Cell;
@@ -20,9 +18,6 @@ use property_bag::*;
use util::*;
use viewbox::*;
-use self::cairo::MatrixTrait;
-
-
/***** NodeGroup *****/
struct NodeGroup ();
diff --git a/rust/src/transform.rs b/rust/src/transform.rs
index 0287413..753e618 100644
--- a/rust/src/transform.rs
+++ b/rust/src/transform.rs
@@ -1,11 +1,9 @@
-extern crate lalrpop_util;
-extern crate glib_sys;
-extern crate glib;
-extern crate libc;
-
-extern crate cairo;
-use self::cairo::MatrixTrait;
-use self::glib::translate::*;
+use ::cairo;
+use ::cairo::MatrixTrait;
+use ::glib::translate::*;
+use ::glib_sys;
+use ::libc;
+
use std::f64::consts::*;
diff --git a/rust/src/viewbox.rs b/rust/src/viewbox.rs
index 798ccce..48a0cfd 100644
--- a/rust/src/viewbox.rs
+++ b/rust/src/viewbox.rs
@@ -1,6 +1,6 @@
-extern crate cairo;
-extern crate glib_sys;
-extern crate glib;
+use ::cairo;
+use ::glib_sys;
+use ::glib;
use std::str::FromStr;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]