summaryrefslogtreecommitdiff
path: root/librsvg
diff options
context:
space:
mode:
authorPaolo Borelli <pborelli@gnome.org>2020-01-06 10:09:08 +0100
committerPaolo Borelli <pborelli@gnome.org>2020-01-06 10:42:58 +0100
commit9561d60a9daa74bef222928f007f92421b26b233 (patch)
tree88e95b458264845785c735469841ffc5dcc38039 /librsvg
parent2b58cbf8d1bd0c3ab6cf4e0e6f1db69139629365 (diff)
downloadlibrsvg-9561d60a9daa74bef222928f007f92421b26b233.tar.gz
Tidy up cairo imports
We do not need anymore to `use cairo;` or other crates when we use the full namespace.
Diffstat (limited to 'librsvg')
-rw-r--r--librsvg/c_api.rs21
-rw-r--r--librsvg/pixbuf_utils.rs11
2 files changed, 12 insertions, 20 deletions
diff --git a/librsvg/c_api.rs b/librsvg/c_api.rs
index 276ec5ee..9c96e396 100644
--- a/librsvg/c_api.rs
+++ b/librsvg/c_api.rs
@@ -7,18 +7,13 @@ use std::slice;
use std::sync::Once;
use std::{f64, i32};
-use cairo::{self, ImageSurface};
-use cairo_sys;
use gdk_pixbuf::Pixbuf;
-use gdk_pixbuf_sys;
use glib::error::ErrorDomain;
-use libc;
use url::Url;
use bitflags::bitflags;
use gio::prelude::*;
-use gio_sys;
use glib::object::ObjectClass;
use glib::subclass;
@@ -31,13 +26,12 @@ use glib::{
ToValue, Type, Value,
};
-use glib_sys;
-use gobject_sys::{self, GEnumValue, GFlagsValue};
+use gobject_sys::{GEnumValue, GFlagsValue};
use rsvg_internals::{
- rsvg_log, DefsLookupErrorKind, Dpi, Handle, IntrinsicDimensions,
- LoadOptions, LoadingError, RenderingError, RsvgDimensionData, RsvgLength, RsvgPositionData,
- RsvgSizeFunc, SharedImageSurface, SizeCallback, SurfaceType, ViewBox,
+ rsvg_log, DefsLookupErrorKind, Dpi, Handle, IntrinsicDimensions, LoadOptions, LoadingError,
+ RenderingError, RsvgDimensionData, RsvgLength, RsvgPositionData, RsvgSizeFunc,
+ SharedImageSurface, SizeCallback, SurfaceType, ViewBox,
};
use crate::pixbuf_utils::{empty_pixbuf, pixbuf_from_surface};
@@ -723,8 +717,11 @@ impl CHandle {
return empty_pixbuf();
}
- let surface =
- ImageSurface::create(cairo::Format::ARgb32, dimensions.width, dimensions.height)?;
+ let surface = cairo::ImageSurface::create(
+ cairo::Format::ARgb32,
+ dimensions.width,
+ dimensions.height,
+ )?;
{
let cr = cairo::Context::new(&surface);
diff --git a/librsvg/pixbuf_utils.rs b/librsvg/pixbuf_utils.rs
index 463e103a..a2fae219 100644
--- a/librsvg/pixbuf_utils.rs
+++ b/librsvg/pixbuf_utils.rs
@@ -1,19 +1,14 @@
use std::path::PathBuf;
use std::ptr;
-use cairo::{self, ImageSurface};
use gdk_pixbuf::{Colorspace, Pixbuf};
-use gdk_pixbuf_sys;
-use gio;
use gio::prelude::*;
use glib::translate::*;
-use glib_sys;
-use libc;
use url::Url;
use rsvg_internals::{
- Dpi, Handle, IRect, LoadOptions, LoadingError, Pixels, RenderingError,
- RsvgDimensionData, SharedImageSurface, SizeCallback, SurfaceType,
+ Dpi, Handle, IRect, LoadOptions, LoadingError, Pixels, RenderingError, RsvgDimensionData,
+ SharedImageSurface, SizeCallback, SurfaceType,
};
use crate::c_api::set_gerror;
@@ -136,7 +131,7 @@ fn render_to_pixbuf_at_size(
return empty_pixbuf();
}
- let surface = ImageSurface::create(cairo::Format::ARgb32, width, height)?;
+ let surface = cairo::ImageSurface::create(cairo::Format::ARgb32, width, height)?;
{
let cr = cairo::Context::new(&surface);