From 2aa0419a409df89346b6d50fdbd2c9925409c5a2 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Tue, 19 Feb 2019 07:26:32 +0100 Subject: [PATCH] Update dependencies (cherry picked from commit c414d178777b44fe14af5a61238be912f2516d10) --- rsvg_internals/Cargo.toml | 4 ++-- rsvg_internals/src/cond.rs | 17 +++++++---------- rsvg_internals/src/filters/convolve_matrix.rs | 4 ++-- rsvg_internals/src/filters/gaussian_blur.rs | 4 ++-- rsvg_internals/src/io.rs | 2 +- rsvg_internals/src/svg.rs | 6 +++--- 6 files changed, 17 insertions(+), 20 deletions(-) diff --git a/rsvg_internals/Cargo.toml b/rsvg_internals/Cargo.toml index 268498b9..2e483e8f 100644 --- a/rsvg_internals/Cargo.toml +++ b/rsvg_internals/Cargo.toml @@ -34,12 +34,12 @@ gio-sys = "0.7.0" glib = "0.6.0" glib-sys = "0.7.0" gobject-sys = "0.7.0" -itertools = "0.7.4" +itertools = "0.8" language-tags = "0.2.2" lazy_static = "1.0.0" libc = "0.2" locale_config = "*" # recommended explicitly by locale_config's README.md -nalgebra = "0.16" +nalgebra = "0.17" num-traits = "0.2" owning_ref = "0.4.0" pango = "0.5.0" diff --git a/rsvg_internals/src/cond.rs b/rsvg_internals/src/cond.rs index 63f77dce..12730369 100644 --- a/rsvg_internals/src/cond.rs +++ b/rsvg_internals/src/cond.rs @@ -4,7 +4,6 @@ use std::ascii::AsciiExt; use std::str::FromStr; use glib; -use itertools::{FoldWhile, Itertools}; use language_tags::LanguageTag; use locale_config::{LanguageRange, Locale}; @@ -89,28 +88,26 @@ impl SystemLanguage { pub fn from_attribute(s: &str, locale: &Locale) -> Result { s.split(',') .map(LanguageTag::from_str) - .fold_while( + .try_fold( // start with no match - Ok(SystemLanguage(false)), + SystemLanguage(false), // The accumulator is Result |acc, tag_result| match tag_result { Ok(language_tag) => { - let have_match = acc.unwrap().0; + let have_match = acc.0; if have_match { - FoldWhile::Continue(Ok(SystemLanguage(have_match))) + Ok(SystemLanguage(have_match)) } else { locale_accepts_language_tag(locale, &language_tag) - .map(|matches| FoldWhile::Continue(Ok(SystemLanguage(matches)))) - .unwrap_or_else(|e| FoldWhile::Done(Err(e))) + .map(|matches| SystemLanguage(matches)) } } - Err(e) => FoldWhile::Done(Err(ValueErrorKind::Parse(ParseError::new( + Err(e) => Err(ValueErrorKind::Parse(ParseError::new( &format!("invalid language tag: \"{}\"", e), - )))), + ))), }, ) - .into_inner() } } diff --git a/rsvg_internals/src/filters/convolve_matrix.rs b/rsvg_internals/src/filters/convolve_matrix.rs index a62f8f45..760d9b55 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 nalgebra::{DMatrix, Dynamic, MatrixVec}; +use nalgebra::{DMatrix, Dynamic, VecStorage}; use attributes::Attribute; use drawing_ctx::DrawingCtx; @@ -193,7 +193,7 @@ impl NodeTrait for ConvolveMatrix { )); } - DMatrix::from_data(MatrixVec::new( + DMatrix::from_data(VecStorage::new( Dynamic::new(self.order.get().1 as usize), Dynamic::new(self.order.get().0 as usize), v, diff --git a/rsvg_internals/src/filters/gaussian_blur.rs b/rsvg_internals/src/filters/gaussian_blur.rs index 6b330aec..c387f9c9 100644 --- a/rsvg_internals/src/filters/gaussian_blur.rs +++ b/rsvg_internals/src/filters/gaussian_blur.rs @@ -3,7 +3,7 @@ use std::cmp::min; use std::f64; use cairo::MatrixTrait; -use nalgebra::{DMatrix, Dynamic, MatrixVec}; +use nalgebra::{DMatrix, Dynamic, VecStorage}; use attributes::Attribute; use drawing_ctx::DrawingCtx; @@ -182,7 +182,7 @@ fn gaussian_blur( } else { (1, kernel.len()) }; - let kernel = DMatrix::from_data(MatrixVec::new( + let kernel = DMatrix::from_data(VecStorage::new( Dynamic::new(rows), Dynamic::new(cols), kernel, diff --git a/rsvg_internals/src/io.rs b/rsvg_internals/src/io.rs index 48efb4ef..d6248496 100644 --- a/rsvg_internals/src/io.rs +++ b/rsvg_internals/src/io.rs @@ -113,7 +113,7 @@ pub fn acquire_data( Ok(BinaryData { data: contents, - content_type: mime_type, + content_type: mime_type.map(From::from), }) } } diff --git a/rsvg_internals/src/svg.rs b/rsvg_internals/src/svg.rs index dc75d9d5..f2908bd2 100644 --- a/rsvg_internals/src/svg.rs +++ b/rsvg_internals/src/svg.rs @@ -194,6 +194,8 @@ fn load_image( if load_options.flags.keep_image_data { if let Some(mime_type) = data.content_type { + let data_ptr = ToGlibContainerFromSlice::to_glib_full_from_slice(&data.data); + extern "C" { fn cairo_surface_set_mime_data( surface: *mut cairo_sys::cairo_surface_t, @@ -205,8 +207,6 @@ fn load_image( ) -> Status; } - let data_ptr = ToGlibContainerFromSlice::to_glib_full_from_slice(&data.data); - unsafe { let status = cairo_surface_set_mime_data( surface.to_glib_none().0, @@ -215,7 +215,7 @@ fn load_image( data.data.len() as libc::c_ulong, Some(glib_sys::g_free), data_ptr as *mut _, - ); + ).into(); if status != Status::Success { return Err(LoadingError::Cairo(status)); -- 2.21.0.rc1