|
1 | 1 | // Take a look at the license at the top of the repository in the LICENSE file.
|
2 | 2 |
|
3 |
| -use crate::font::{ |
4 |
| - FontExtents, FontFace, FontOptions, Glyph, ScaledFont, TextCluster, TextExtents, |
5 |
| -}; |
6 |
| -use crate::matrices::Matrix; |
7 |
| -use crate::paths::Path; |
8 |
| -use crate::Rectangle; |
9 |
| -use crate::{ |
10 |
| - Antialias, Content, FillRule, FontSlant, FontWeight, LineCap, LineJoin, Operator, |
11 |
| - TextClusterFlags, |
12 |
| -}; |
| 3 | +use std::{ffi::CString, fmt, mem::MaybeUninit, ops, ptr, slice}; |
| 4 | + |
13 | 5 | #[cfg(feature = "use_glib")]
|
14 | 6 | use glib::translate::*;
|
15 |
| -use std::ffi::CString; |
16 |
| -use std::fmt; |
17 |
| -use std::mem::MaybeUninit; |
18 |
| -use std::ops; |
19 |
| -use std::ptr; |
20 |
| -use std::slice; |
21 |
| - |
22 |
| -use crate::error::Error; |
23 |
| -use crate::ffi::{cairo_rectangle_list_t, cairo_t}; |
24 |
| -use crate::patterns::Pattern; |
25 |
| -use crate::surface::Surface; |
26 |
| -use crate::utils::status_to_result; |
| 7 | + |
| 8 | +use crate::{ |
| 9 | + ffi::{cairo_rectangle_list_t, cairo_t}, |
| 10 | + utils::status_to_result, |
| 11 | + Antialias, Content, Error, FillRule, FontExtents, FontFace, FontOptions, FontSlant, FontWeight, |
| 12 | + Glyph, LineCap, LineJoin, Matrix, Operator, Path, Pattern, Rectangle, ScaledFont, Surface, |
| 13 | + TextCluster, TextClusterFlags, TextExtents, |
| 14 | +}; |
27 | 15 |
|
28 | 16 | pub struct RectangleList {
|
29 | 17 | ptr: *mut cairo_rectangle_list_t,
|
@@ -958,12 +946,11 @@ impl fmt::Display for Context {
|
958 | 946 |
|
959 | 947 | #[cfg(test)]
|
960 | 948 | mod tests {
|
961 |
| - use super::*; |
962 |
| - use crate::enums::Format; |
963 |
| - use crate::image_surface::ImageSurface; |
964 |
| - use crate::patterns::LinearGradient; |
965 | 949 | use float_eq::float_eq;
|
966 | 950 |
|
| 951 | + use super::*; |
| 952 | + use crate::{enums::Format, image_surface::ImageSurface, patterns::LinearGradient}; |
| 953 | + |
967 | 954 | fn create_ctx() -> Context {
|
968 | 955 | let surface = ImageSurface::create(Format::ARgb32, 10, 10).unwrap();
|
969 | 956 | Context::new(&surface).expect("Can't create a Cairo context")
|
|
0 commit comments