Fix (new) clippy warnings

This commit is contained in:
Guillaume Gomez 2021-08-05 14:36:16 +03:00 committed by Sebastian Dröge
parent 566cfb879b
commit e3ad81d473
5 changed files with 10 additions and 10 deletions

View file

@ -28,7 +28,7 @@ fn example_main() {
let mut context = gst::ParseContext::new();
let pipeline =
match gst::parse_launch_full(&pipeline_str, Some(&mut context), gst::ParseFlags::empty()) {
match gst::parse_launch_full(pipeline_str, Some(&mut context), gst::ParseFlags::empty()) {
Ok(pipeline) => pipeline,
Err(err) => {
if let Some(gst::ParseError::NoSuchElement) = err.kind::<gst::ParseError>() {

View file

@ -79,7 +79,7 @@ fn create_pipeline(uri: String, out_path: std::path::PathBuf) -> Result<gst::Pip
})?;
let caps = sample.caps().expect("Sample without caps");
let info = gst_video::VideoInfo::from_caps(&caps).expect("Failed to parse caps");
let info = gst_video::VideoInfo::from_caps(caps).expect("Failed to parse caps");
// Make sure that we only get a single buffer
if got_snapshot {

View file

@ -20,8 +20,8 @@ const CAPS_FEATURES_VARIANT_SOME_ID: u32 = 1;
const CAPS_FEATURES_VARIANT_SOME_STR: &str = "Some";
const CAPS_FEATURES_VARIANT_NAMES: &[&str] = &[
&CAPS_FEATURES_VARIANT_ANY_STR,
&CAPS_FEATURES_VARIANT_SOME_STR,
CAPS_FEATURES_VARIANT_ANY_STR,
CAPS_FEATURES_VARIANT_SOME_STR,
];
struct CapsFeaturesForIterSe<'a>(&'a CapsFeaturesRef);
@ -55,7 +55,7 @@ impl Serialize for CapsFeaturesRef {
stringify!(CapsFeatures),
CAPS_FEATURES_VARIANT_SOME_ID,
CAPS_FEATURES_VARIANT_SOME_STR,
&CapsFeaturesForIterSe(&self),
&CapsFeaturesForIterSe(self),
)
}
}

View file

@ -27,9 +27,9 @@ const CAPS_VARIANT_SOME_ID: u32 = 2;
const CAPS_VARIANT_SOME_STR: &str = "Some";
const CAPS_VARIANT_NAMES: &[&str] = &[
&CAPS_VARIANT_ANY_STR,
&CAPS_VARIANT_EMPTY_STR,
&CAPS_VARIANT_SOME_STR,
CAPS_VARIANT_ANY_STR,
CAPS_VARIANT_EMPTY_STR,
CAPS_VARIANT_SOME_STR,
];
struct CapsItemSe<'a>(&'a StructureRef, Option<&'a CapsFeaturesRef>);
@ -86,7 +86,7 @@ impl Serialize for CapsRef {
stringify!(Caps),
CAPS_VARIANT_SOME_ID,
CAPS_VARIANT_SOME_STR,
&CapsForIterSe(&self),
&CapsForIterSe(self),
)
}
}

View file

@ -104,7 +104,7 @@ impl<'a> Serialize for TagsSer<'a> {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
let mut tup = serializer.serialize_tuple(2)?;
tup.serialize_element(self.0)?;
tup.serialize_element(&TagValuesSer::from(&self))?;
tup.serialize_element(&TagValuesSer::from(self))?;
tup.end()
}
}