Run through rustfmt once again

This commit is contained in:
Sebastian Dröge 2018-10-28 13:47:02 +00:00
parent 54d8065dd3
commit 8a6bcbcedb
11 changed files with 35 additions and 58 deletions

View file

@ -29,9 +29,7 @@ struct MissingElement(&'static str);
#[derive(Debug, Fail)]
#[fail(
display = "Received error from {}: {} (debug: {:?})",
src,
error,
debug
src, error, debug
)]
struct ErrorMessage {
src: String,

View file

@ -23,9 +23,7 @@ struct MissingElement(&'static str);
#[derive(Debug, Fail)]
#[fail(
display = "Received error from {}: {} (debug: {:?})",
src,
error,
debug
src, error, debug
)]
struct ErrorMessage {
src: String,

View file

@ -25,9 +25,7 @@ struct MissingElement(&'static str);
#[derive(Debug, Fail)]
#[fail(
display = "Received error from {}: {} (debug: {:?})",
src,
error,
debug
src, error, debug
)]
struct ErrorMessage {
src: String,

View file

@ -28,9 +28,7 @@ struct MissingElement(&'static str);
#[derive(Debug, Fail)]
#[fail(
display = "Received error from {}: {} (debug: {:?})",
src,
error,
debug
src, error, debug
)]
struct ErrorMessage {
src: String,

View file

@ -29,9 +29,7 @@ struct MissingElement(&'static str);
#[derive(Debug, Fail)]
#[fail(
display = "Received error from {}: {} (debug: {:?})",
src,
error,
debug
src, error, debug
)]
struct ErrorMessage {
src: String,

View file

@ -35,9 +35,7 @@ struct UsageError(String);
#[derive(Debug, Fail)]
#[fail(
display = "Received error from {}: {} (debug: {:?})",
src,
error,
debug
src, error, debug
)]
struct ErrorMessage {
src: String,

View file

@ -32,9 +32,7 @@ struct UsageError(String);
#[derive(Debug, Fail)]
#[fail(
display = "Received error from {}: {} (debug: {:?})",
src,
error,
debug
src, error, debug
)]
struct ErrorMessage {
src: String,

View file

@ -21,9 +21,7 @@ struct MissingElement(String);
#[derive(Debug, Fail)]
#[fail(
display = "Received error from {}: {} (debug: {:?})",
src,
error,
debug
src, error, debug
)]
struct ErrorMessage {
src: String,

View file

@ -579,21 +579,19 @@ mod tests {
.as_ref()
);
}
assert!(
caps.get_features(0)
.unwrap()
.is_equal(::CAPS_FEATURES_MEMORY_SYSTEM_MEMORY.as_ref())
);
assert!(caps
.get_features(0)
.unwrap()
.is_equal(::CAPS_FEATURES_MEMORY_SYSTEM_MEMORY.as_ref()));
{
let caps = caps.get_mut().unwrap();
caps.set_features(0, Some(CapsFeatures::new(&["foo:bla"])));
}
assert!(
caps.get_features(0)
.unwrap()
.is_equal(CapsFeatures::new(&["foo:bla"]).as_ref())
);
assert!(caps
.get_features(0)
.unwrap()
.is_equal(CapsFeatures::new(&["foo:bla"]).as_ref()));
}
#[test]

View file

@ -56,8 +56,8 @@ impl<'a> Serialize for CapsForIterSe<'a> {
if size > 0 {
let mut seq = serializer.serialize_seq(Some(size))?;
for (structure, features) in iter {
let features = if !features.is_any() && features
.is_equal(::CAPS_FEATURES_MEMORY_SYSTEM_MEMORY.as_ref())
let features = if !features.is_any()
&& features.is_equal(::CAPS_FEATURES_MEMORY_SYSTEM_MEMORY.as_ref())
{
None
} else {
@ -118,11 +118,9 @@ impl<'de> Visitor<'de> for CapsItemVisitor {
let structure = seq
.next_element::<Structure>()?
.ok_or_else(|| de::Error::custom("Expected a `Structure` for `Caps` item"))?;
let features_option =
seq.next_element::<Option<CapsFeatures>>()?
.ok_or_else(|| de::Error::custom(
"Expected an `Option<CapsFeature>` for `Caps` item",
))?;
let features_option = seq.next_element::<Option<CapsFeatures>>()?.ok_or_else(|| {
de::Error::custom("Expected an `Option<CapsFeature>` for `Caps` item")
})?;
Ok(CapsItemDe(structure, features_option))
}

View file

@ -586,7 +586,8 @@ impl<'a, T: Tag<'a>> ExactSizeIterator for TagIterator<'a, T>
where
<T as Tag<'a>>::TagType: 'a,
T: 'a,
{}
{
}
pub struct GenericTagIterator<'a> {
taglist: &'a TagListRef,
@ -813,22 +814,18 @@ mod tests {
let mut tags = TagList::new();
{
let tags = tags.get_mut().unwrap();
assert!(
tags.add_generic(&TAG_TITLE, &"some title", TagMergeMode::Append)
.is_ok()
);
assert!(
tags.add_generic(&TAG_TITLE, &"second title", TagMergeMode::Append)
.is_ok()
);
assert!(
tags.add_generic(&TAG_DURATION, &(::SECOND * 120), TagMergeMode::Append)
.is_ok()
);
assert!(
tags.add_generic(&TAG_TITLE, &"third title", TagMergeMode::Append)
.is_ok()
);
assert!(tags
.add_generic(&TAG_TITLE, &"some title", TagMergeMode::Append)
.is_ok());
assert!(tags
.add_generic(&TAG_TITLE, &"second title", TagMergeMode::Append)
.is_ok());
assert!(tags
.add_generic(&TAG_DURATION, &(::SECOND * 120), TagMergeMode::Append)
.is_ok());
assert!(tags
.add_generic(&TAG_TITLE, &"third title", TagMergeMode::Append)
.is_ok());
assert_eq!(
tags.add_generic(