mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-12-23 00:26:31 +00:00
Run through rustfmt once again
This commit is contained in:
parent
54d8065dd3
commit
8a6bcbcedb
11 changed files with 35 additions and 58 deletions
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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))
|
||||
}
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue