cargo fmt now, for good measure :)

parent 9254017d
Pipeline #61183 passed with stages
in 42 minutes and 12 seconds
......@@ -34,16 +34,18 @@ fn main() {
let surface = cairo::ImageSurface::create(cairo::Format::ARgb32, width, height).unwrap();
let cr = cairo::Context::new(&surface);
renderer.render_element_to_viewport(
&cr,
None,
&cairo::Rectangle {
x: 0.0,
y: 0.0,
width: f64::from(width),
height: f64::from(height),
}
).unwrap();
renderer
.render_element_to_viewport(
&cr,
None,
&cairo::Rectangle {
x: 0.0,
y: 0.0,
width: f64::from(width),
height: f64::from(height),
},
)
.unwrap();
let mut file = BufWriter::new(File::create(output).unwrap());
......
......@@ -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
)))),
},
)
}
}
......
......@@ -224,7 +224,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));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment