Commit 8a6bcbce authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

Run through rustfmt once again

parent 54d8065d
...@@ -29,9 +29,7 @@ struct MissingElement(&'static str); ...@@ -29,9 +29,7 @@ struct MissingElement(&'static str);
#[derive(Debug, Fail)] #[derive(Debug, Fail)]
#[fail( #[fail(
display = "Received error from {}: {} (debug: {:?})", display = "Received error from {}: {} (debug: {:?})",
src, src, error, debug
error,
debug
)] )]
struct ErrorMessage { struct ErrorMessage {
src: String, src: String,
......
...@@ -23,9 +23,7 @@ struct MissingElement(&'static str); ...@@ -23,9 +23,7 @@ struct MissingElement(&'static str);
#[derive(Debug, Fail)] #[derive(Debug, Fail)]
#[fail( #[fail(
display = "Received error from {}: {} (debug: {:?})", display = "Received error from {}: {} (debug: {:?})",
src, src, error, debug
error,
debug
)] )]
struct ErrorMessage { struct ErrorMessage {
src: String, src: String,
......
...@@ -25,9 +25,7 @@ struct MissingElement(&'static str); ...@@ -25,9 +25,7 @@ struct MissingElement(&'static str);
#[derive(Debug, Fail)] #[derive(Debug, Fail)]
#[fail( #[fail(
display = "Received error from {}: {} (debug: {:?})", display = "Received error from {}: {} (debug: {:?})",
src, src, error, debug
error,
debug
)] )]
struct ErrorMessage { struct ErrorMessage {
src: String, src: String,
......
...@@ -28,9 +28,7 @@ struct MissingElement(&'static str); ...@@ -28,9 +28,7 @@ struct MissingElement(&'static str);
#[derive(Debug, Fail)] #[derive(Debug, Fail)]
#[fail( #[fail(
display = "Received error from {}: {} (debug: {:?})", display = "Received error from {}: {} (debug: {:?})",
src, src, error, debug
error,
debug
)] )]
struct ErrorMessage { struct ErrorMessage {
src: String, src: String,
......
...@@ -29,9 +29,7 @@ struct MissingElement(&'static str); ...@@ -29,9 +29,7 @@ struct MissingElement(&'static str);
#[derive(Debug, Fail)] #[derive(Debug, Fail)]
#[fail( #[fail(
display = "Received error from {}: {} (debug: {:?})", display = "Received error from {}: {} (debug: {:?})",
src, src, error, debug
error,
debug
)] )]
struct ErrorMessage { struct ErrorMessage {
src: String, src: String,
......
...@@ -35,9 +35,7 @@ struct UsageError(String); ...@@ -35,9 +35,7 @@ struct UsageError(String);
#[derive(Debug, Fail)] #[derive(Debug, Fail)]
#[fail( #[fail(
display = "Received error from {}: {} (debug: {:?})", display = "Received error from {}: {} (debug: {:?})",
src, src, error, debug
error,
debug
)] )]
struct ErrorMessage { struct ErrorMessage {
src: String, src: String,
......
...@@ -32,9 +32,7 @@ struct UsageError(String); ...@@ -32,9 +32,7 @@ struct UsageError(String);
#[derive(Debug, Fail)] #[derive(Debug, Fail)]
#[fail( #[fail(
display = "Received error from {}: {} (debug: {:?})", display = "Received error from {}: {} (debug: {:?})",
src, src, error, debug
error,
debug
)] )]
struct ErrorMessage { struct ErrorMessage {
src: String, src: String,
......
...@@ -21,9 +21,7 @@ struct MissingElement(String); ...@@ -21,9 +21,7 @@ struct MissingElement(String);
#[derive(Debug, Fail)] #[derive(Debug, Fail)]
#[fail( #[fail(
display = "Received error from {}: {} (debug: {:?})", display = "Received error from {}: {} (debug: {:?})",
src, src, error, debug
error,
debug
)] )]
struct ErrorMessage { struct ErrorMessage {
src: String, src: String,
......
...@@ -579,21 +579,19 @@ mod tests { ...@@ -579,21 +579,19 @@ mod tests {
.as_ref() .as_ref()
); );
} }
assert!( assert!(caps
caps.get_features(0) .get_features(0)
.unwrap() .unwrap()
.is_equal(::CAPS_FEATURES_MEMORY_SYSTEM_MEMORY.as_ref()) .is_equal(::CAPS_FEATURES_MEMORY_SYSTEM_MEMORY.as_ref()));
);
{ {
let caps = caps.get_mut().unwrap(); let caps = caps.get_mut().unwrap();
caps.set_features(0, Some(CapsFeatures::new(&["foo:bla"]))); caps.set_features(0, Some(CapsFeatures::new(&["foo:bla"])));
} }
assert!( assert!(caps
caps.get_features(0) .get_features(0)
.unwrap() .unwrap()
.is_equal(CapsFeatures::new(&["foo:bla"]).as_ref()) .is_equal(CapsFeatures::new(&["foo:bla"]).as_ref()));
);
} }
#[test] #[test]
......
...@@ -56,8 +56,8 @@ impl<'a> Serialize for CapsForIterSe<'a> { ...@@ -56,8 +56,8 @@ impl<'a> Serialize for CapsForIterSe<'a> {
if size > 0 { if size > 0 {
let mut seq = serializer.serialize_seq(Some(size))?; let mut seq = serializer.serialize_seq(Some(size))?;
for (structure, features) in iter { for (structure, features) in iter {
let features = if !features.is_any() && features let features = if !features.is_any()
.is_equal(::CAPS_FEATURES_MEMORY_SYSTEM_MEMORY.as_ref()) && features.is_equal(::CAPS_FEATURES_MEMORY_SYSTEM_MEMORY.as_ref())
{ {
None None
} else { } else {
...@@ -118,11 +118,9 @@ impl<'de> Visitor<'de> for CapsItemVisitor { ...@@ -118,11 +118,9 @@ impl<'de> Visitor<'de> for CapsItemVisitor {
let structure = seq let structure = seq
.next_element::<Structure>()? .next_element::<Structure>()?
.ok_or_else(|| de::Error::custom("Expected a `Structure` for `Caps` item"))?; .ok_or_else(|| de::Error::custom("Expected a `Structure` for `Caps` item"))?;
let features_option = let features_option = seq.next_element::<Option<CapsFeatures>>()?.ok_or_else(|| {
seq.next_element::<Option<CapsFeatures>>()? de::Error::custom("Expected an `Option<CapsFeature>` for `Caps` item")
.ok_or_else(|| de::Error::custom( })?;
"Expected an `Option<CapsFeature>` for `Caps` item",
))?;
Ok(CapsItemDe(structure, features_option)) Ok(CapsItemDe(structure, features_option))
} }
......
...@@ -586,7 +586,8 @@ impl<'a, T: Tag<'a>> ExactSizeIterator for TagIterator<'a, T> ...@@ -586,7 +586,8 @@ impl<'a, T: Tag<'a>> ExactSizeIterator for TagIterator<'a, T>
where where
<T as Tag<'a>>::TagType: 'a, <T as Tag<'a>>::TagType: 'a,
T: 'a, T: 'a,
{} {
}
pub struct GenericTagIterator<'a> { pub struct GenericTagIterator<'a> {
taglist: &'a TagListRef, taglist: &'a TagListRef,
...@@ -813,22 +814,18 @@ mod tests { ...@@ -813,22 +814,18 @@ mod tests {
let mut tags = TagList::new(); let mut tags = TagList::new();
{ {
let tags = tags.get_mut().unwrap(); let tags = tags.get_mut().unwrap();
assert!( assert!(tags
tags.add_generic(&TAG_TITLE, &"some title", TagMergeMode::Append) .add_generic(&TAG_TITLE, &"some title", TagMergeMode::Append)
.is_ok() .is_ok());
); assert!(tags
assert!( .add_generic(&TAG_TITLE, &"second title", TagMergeMode::Append)
tags.add_generic(&TAG_TITLE, &"second title", TagMergeMode::Append) .is_ok());
.is_ok() assert!(tags
); .add_generic(&TAG_DURATION, &(::SECOND * 120), TagMergeMode::Append)
assert!( .is_ok());
tags.add_generic(&TAG_DURATION, &(::SECOND * 120), TagMergeMode::Append) assert!(tags
.is_ok() .add_generic(&TAG_TITLE, &"third title", TagMergeMode::Append)
); .is_ok());
assert!(
tags.add_generic(&TAG_TITLE, &"third title", TagMergeMode::Append)
.is_ok()
);
assert_eq!( assert_eq!(
tags.add_generic( tags.add_generic(
......
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