[librsvg] cargo fmt
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] cargo fmt
- Date: Thu, 4 Jun 2020 17:11:45 +0000 (UTC)
commit 606031f890d481e837230edc3de1525d48d02eee
Author: Federico Mena Quintero <federico gnome org>
Date: Thu Jun 4 12:11:23 2020 -0500
cargo fmt
librsvg/benches/pixbuf_from_surface.rs | 4 +---
librsvg/pixbuf_utils.rs | 6 +++---
rsvg_internals/src/font_props.rs | 4 +++-
rsvg_internals/src/surface_utils/mod.rs | 8 ++------
rsvg_internals/src/surface_utils/shared_surface.rs | 6 +++++-
5 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/librsvg/benches/pixbuf_from_surface.rs b/librsvg/benches/pixbuf_from_surface.rs
index 7e2cf26a..fa237495 100644
--- a/librsvg/benches/pixbuf_from_surface.rs
+++ b/librsvg/benches/pixbuf_from_surface.rs
@@ -18,8 +18,7 @@ const BOUNDS: IRect = IRect {
fn bench_pixbuf_from_surface(c: &mut Criterion) {
c.bench_function("pixbuf_from_surface", |b| {
- let mut surface =
- ExclusiveImageSurface::new(256, 256, SurfaceType::SRgb).unwrap();
+ let mut surface = ExclusiveImageSurface::new(256, 256, SurfaceType::SRgb).unwrap();
// Fill the surface with interesting data
surface.modify(&mut |data, stride| {
@@ -44,7 +43,6 @@ fn bench_pixbuf_from_surface(c: &mut Criterion) {
})
});
}
-
criterion_group!(
name = benches;
diff --git a/librsvg/pixbuf_utils.rs b/librsvg/pixbuf_utils.rs
index b7fc563d..d9f181c8 100644
--- a/librsvg/pixbuf_utils.rs
+++ b/librsvg/pixbuf_utils.rs
@@ -10,8 +10,7 @@ use url::Url;
use crate::c_api::checked_i32;
use rsvg_internals::{
- Dpi, Handle, LoadOptions, LoadingError, Pixel, RenderingError, SharedImageSurface,
- SurfaceType,
+ Dpi, Handle, LoadOptions, LoadingError, Pixel, RenderingError, SharedImageSurface, SurfaceType,
};
use crate::c_api::set_gerror;
@@ -65,7 +64,8 @@ pub fn pixbuf_from_surface(surface: &SharedImageSurface) -> Result<Pixbuf, Rende
g: src.g,
b: src.b,
a: src.a,
- }.unpremultiply();
+ }
+ .unpremultiply();
(pixel.r, pixel.g, pixel.b, pixel.a)
};
diff --git a/rsvg_internals/src/font_props.rs b/rsvg_internals/src/font_props.rs
index 5e06567e..e09061d9 100644
--- a/rsvg_internals/src/font_props.rs
+++ b/rsvg_internals/src/font_props.rs
@@ -378,7 +378,9 @@ mod tests {
fn parses_multiple_font_family() {
assert_eq!(
<MultiFontFamily as Parse>::parse_str("serif,monospace,\"Hello world\", with spaces "),
- Ok(MultiFontFamily("serif,monospace,Hello world,with spaces".to_owned()))
+ Ok(MultiFontFamily(
+ "serif,monospace,Hello world,with spaces".to_owned()
+ ))
);
}
diff --git a/rsvg_internals/src/surface_utils/mod.rs b/rsvg_internals/src/surface_utils/mod.rs
index 6ee579b4..44667918 100644
--- a/rsvg_internals/src/surface_utils/mod.rs
+++ b/rsvg_internals/src/surface_utils/mod.rs
@@ -32,16 +32,12 @@ pub trait AsCairoARGB<T: Copy> {
impl<T: Copy> AsCairoARGB<T> for [T] {
fn as_cairo_argb(&self) -> &[CairoARGB] {
debug_assert_eq!(4, mem::size_of::<CairoARGB>() / mem::size_of::<T>());
- unsafe {
- slice::from_raw_parts(self.as_ptr() as *const _, self.len() / 4)
- }
+ unsafe { slice::from_raw_parts(self.as_ptr() as *const _, self.len() / 4) }
}
fn as_cairo_argb_mut(&mut self) -> &mut [CairoARGB] {
debug_assert_eq!(4, mem::size_of::<CairoARGB>() / mem::size_of::<T>());
- unsafe {
- slice::from_raw_parts_mut(self.as_ptr() as *mut _, self.len() / 4)
- }
+ unsafe { slice::from_raw_parts_mut(self.as_ptr() as *mut _, self.len() / 4) }
}
}
diff --git a/rsvg_internals/src/surface_utils/shared_surface.rs
b/rsvg_internals/src/surface_utils/shared_surface.rs
index d357b19d..427fb795 100644
--- a/rsvg_internals/src/surface_utils/shared_surface.rs
+++ b/rsvg_internals/src/surface_utils/shared_surface.rs
@@ -1195,7 +1195,11 @@ impl<'a> Iterator for Rows<'a> {
self.next_row += 1;
unsafe {
- let row_ptr = self.surface.data_ptr.as_ptr().offset(row as isize * self.surface.stride);
+ let row_ptr = self
+ .surface
+ .data_ptr
+ .as_ptr()
+ .offset(row as isize * self.surface.stride);
let row_of_bytes = slice::from_raw_parts(row_ptr, self.surface.width as usize * 4);
let pixels = row_of_bytes.as_cairo_argb();
assert!(pixels.len() == self.surface.width as usize);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]