[librsvg/wip/subclass: 5/5] cargo fmt
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/wip/subclass: 5/5] cargo fmt
- Date: Sat, 16 Feb 2019 01:13:22 +0000 (UTC)
commit 70acea9572b58459e2a8119226cc797ad198c20f
Author: Federico Mena Quintero <federico gnome org>
Date: Fri Feb 15 19:08:45 2019 -0600
cargo fmt
rsvg_internals/src/cond.rs | 41 ++++++++++++++++++++---------------------
rsvg_internals/src/svg.rs | 5 +++--
2 files changed, 23 insertions(+), 23 deletions(-)
---
diff --git a/rsvg_internals/src/cond.rs b/rsvg_internals/src/cond.rs
index 12730369..4099ec40 100644
--- a/rsvg_internals/src/cond.rs
+++ b/rsvg_internals/src/cond.rs
@@ -86,28 +86,27 @@ impl SystemLanguage {
/// [`systemLanguage`]:
https://www.w3.org/TR/SVG/struct.html#ConditionalProcessingSystemLanguageAttribute
/// [BCP47]: http://www.ietf.org/rfc/bcp/bcp47.txt
pub fn from_attribute(s: &str, locale: &Locale) -> Result<SystemLanguage, ValueErrorKind> {
- s.split(',')
- .map(LanguageTag::from_str)
- .try_fold(
- // start with no match
- SystemLanguage(false),
- // The accumulator is Result<SystemLanguage, ValueErrorKind>
- |acc, tag_result| match tag_result {
- Ok(language_tag) => {
- let have_match = acc.0;
- if have_match {
- Ok(SystemLanguage(have_match))
- } else {
- locale_accepts_language_tag(locale, &language_tag)
- .map(|matches| SystemLanguage(matches))
- }
+ s.split(',').map(LanguageTag::from_str).try_fold(
+ // start with no match
+ SystemLanguage(false),
+ // The accumulator is Result<SystemLanguage, ValueErrorKind>
+ |acc, tag_result| match tag_result {
+ Ok(language_tag) => {
+ let have_match = acc.0;
+ if have_match {
+ Ok(SystemLanguage(have_match))
+ } else {
+ locale_accepts_language_tag(locale, &language_tag)
+ .map(|matches| SystemLanguage(matches))
}
-
- Err(e) => Err(ValueErrorKind::Parse(ParseError::new(
- &format!("invalid language tag: \"{}\"", e),
- ))),
- },
- )
+ }
+
+ Err(e) => Err(ValueErrorKind::Parse(ParseError::new(&format!(
+ "invalid language tag: \"{}\"",
+ e
+ )))),
+ },
+ )
}
}
diff --git a/rsvg_internals/src/svg.rs b/rsvg_internals/src/svg.rs
index 2181b996..50da17a6 100644
--- a/rsvg_internals/src/svg.rs
+++ b/rsvg_internals/src/svg.rs
@@ -1,5 +1,5 @@
-use cairo_sys::cairo_surface_set_mime_data;
use cairo::Status;
+use cairo_sys::cairo_surface_set_mime_data;
use gdk_pixbuf::{PixbufLoader, PixbufLoaderExt};
use gio;
use glib::translate::*;
@@ -205,7 +205,8 @@ fn load_image(
data.data.len() as libc::c_ulong,
Some(glib_sys::g_free),
data_ptr as *mut _,
- ).into();
+ )
+ .into();
if status != Status::Success {
return Err(LoadingError::Cairo(status));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]