diff --git a/examples/src/bin/appsink.rs b/examples/src/bin/appsink.rs index eb9bf40f8..fba83a252 100644 --- a/examples/src/bin/appsink.rs +++ b/examples/src/bin/appsink.rs @@ -67,7 +67,7 @@ fn create_pipeline() -> Result { let sum: f64 = samples .iter() .map(|sample| { - let f = (*sample as f64) / (i16::MAX as f64); + let f = f64::from(*sample) / f64::from(i16::MAX); f * f }) .sum(); diff --git a/examples/src/bin/decodebin.rs b/examples/src/bin/decodebin.rs index d4f65e927..efd838924 100644 --- a/examples/src/bin/decodebin.rs +++ b/examples/src/bin/decodebin.rs @@ -13,7 +13,7 @@ fn main() { let uri: &str = if args.len() == 2 { args[1].as_ref() } else { - panic!("Usage: decodebin file_path"); + panic!("Usage: decodebin file_path") }; let pipeline = gst::Pipeline::new(None); diff --git a/examples/src/bin/launch.rs b/examples/src/bin/launch.rs index 20febb1ea..f7a273b8d 100644 --- a/examples/src/bin/launch.rs +++ b/examples/src/bin/launch.rs @@ -21,7 +21,7 @@ fn main() { println!("Failed to parse pipeline: {}", err); } - process::exit(-1); + process::exit(-1) } }; let bus = pipeline.get_bus().unwrap(); diff --git a/examples/src/bin/pad_probes.rs b/examples/src/bin/pad_probes.rs index 573a93b47..43d5cf35e 100644 --- a/examples/src/bin/pad_probes.rs +++ b/examples/src/bin/pad_probes.rs @@ -37,7 +37,7 @@ fn main() { let sum: f64 = samples .iter() .map(|sample| { - let f = (*sample as f64) / (i16::MAX as f64); + let f = f64::from(*sample) / f64::from(i16::MAX); f * f }) .sum(); diff --git a/examples/src/bin/playbin.rs b/examples/src/bin/playbin.rs index 4f009e30b..b9dc502c9 100644 --- a/examples/src/bin/playbin.rs +++ b/examples/src/bin/playbin.rs @@ -13,7 +13,7 @@ fn main() { let uri: &str = if args.len() == 2 { args[1].as_ref() } else { - panic!("Usage: playbin uri"); + panic!("Usage: playbin uri") }; let playbin = gst::ElementFactory::make("playbin", None).unwrap(); diff --git a/examples/src/bin/player.rs b/examples/src/bin/player.rs index 36d30c03f..eda233c4b 100644 --- a/examples/src/bin/player.rs +++ b/examples/src/bin/player.rs @@ -76,7 +76,7 @@ fn main() { let uri: &str = if args.len() == 2 { args[1].as_ref() } else { - panic!("Usage: player uri"); + panic!("Usage: player uri") }; match main_loop(uri) { diff --git a/examples/src/bin/toc.rs b/examples/src/bin/toc.rs index ff05648a3..fed9e0be2 100644 --- a/examples/src/bin/toc.rs +++ b/examples/src/bin/toc.rs @@ -13,7 +13,7 @@ fn main() { let uri: &str = if args.len() == 2 { args[1].as_ref() } else { - panic!("Usage: toc file_path"); + panic!("Usage: toc file_path") }; let pipeline = gst::Pipeline::new(None); @@ -61,7 +61,7 @@ fn main() { }; match msg.view() { - MessageView::Eos(..) => break, + MessageView::Eos(_) | MessageView::AsyncDone(_) => break, MessageView::Error(err) => { println!( "Error from {}: {} ({:?})", @@ -71,7 +71,6 @@ fn main() { ); break; } - MessageView::AsyncDone(_) => break, MessageView::Toc(msg_toc) => { let (toc, updated) = msg_toc.get_toc(); println!(