examples: Fix various clippy warnings

This commit is contained in:
Sebastian Dröge 2019-10-04 10:47:48 +03:00
parent 06cfcd57fc
commit 107ae588f2
8 changed files with 24 additions and 20 deletions

View file

@ -162,7 +162,7 @@ fn main_loop(pipeline: gst::Pipeline) -> Result<(), Error> {
MessageView::Eos(..) => break,
MessageView::Error(err) => {
pipeline.set_state(gst::State::Null)?;
Err(ErrorMessage {
return Err(ErrorMessage {
src: msg
.get_src()
.map(|s| String::from(s.get_path_string()))
@ -170,7 +170,8 @@ fn main_loop(pipeline: gst::Pipeline) -> Result<(), Error> {
error: err.get_error().description().into(),
debug: Some(err.get_debug().unwrap().to_string()),
cause: err.get_error(),
})?;
}
.into());
}
_ => (),
}

View file

@ -154,7 +154,7 @@ fn main_loop(pipeline: gst::Pipeline) -> Result<(), Error> {
MessageView::Eos(..) => break,
MessageView::Error(err) => {
pipeline.set_state(gst::State::Null)?;
Err(ErrorMessage {
return Err(ErrorMessage {
src: msg
.get_src()
.map(|s| String::from(s.get_path_string()))
@ -162,7 +162,8 @@ fn main_loop(pipeline: gst::Pipeline) -> Result<(), Error> {
error: err.get_error().description().into(),
debug: Some(err.get_debug().unwrap().to_string()),
cause: err.get_error(),
})?;
}
.into());
}
_ => (),
}

View file

@ -289,7 +289,7 @@ fn example_main() -> Result<(), Error> {
}
#[cfg(not(feature = "v1_10"))]
{
Err(ErrorMessage {
return Err(ErrorMessage {
src: msg
.get_src()
.map(|s| String::from(s.get_path_string()))
@ -297,9 +297,9 @@ fn example_main() -> Result<(), Error> {
error: err.get_error().description().into(),
debug: Some(err.get_debug().unwrap().to_string()),
cause: err.get_error(),
})?;
}
break;
.into());
}
}
MessageView::StateChanged(s) => {
println!(

View file

@ -318,7 +318,7 @@ fn example_main() -> Result<(), Error> {
}
#[cfg(not(feature = "v1_10"))]
{
Err(ErrorMessage {
return Err(ErrorMessage {
src: msg
.get_src()
.map(|s| String::from(s.get_path_string()))
@ -326,9 +326,9 @@ fn example_main() -> Result<(), Error> {
error: err.get_error().description().into(),
debug: Some(err.get_debug().unwrap().to_string()),
cause: err.get_error(),
})?;
}
break;
.into());
}
}
MessageView::StateChanged(s) => {
println!(

View file

@ -588,7 +588,7 @@ impl App {
match msg.view() {
MessageView::Eos(..) => break,
MessageView::Error(err) => {
Err(ErrorMessage {
return Err(ErrorMessage {
src: msg
.get_src()
.map(|s| String::from(s.get_path_string()))
@ -596,7 +596,8 @@ impl App {
error: err.get_error().description().into(),
debug: Some(err.get_debug().unwrap().to_string()),
cause: err.get_error(),
})?;
}
.into());
}
_ => (),
}

View file

@ -251,7 +251,7 @@ fn main_loop(pipeline: gst::Pipeline) -> Result<(), Error> {
MessageView::Eos(..) => break,
MessageView::Error(err) => {
pipeline.set_state(gst::State::Null)?;
Err(ErrorMessage {
return Err(ErrorMessage {
src: msg
.get_src()
.map(|s| String::from(s.get_path_string()))
@ -259,7 +259,8 @@ fn main_loop(pipeline: gst::Pipeline) -> Result<(), Error> {
error: err.get_error().description().into(),
debug: Some(err.get_debug().unwrap().to_string()),
cause: err.get_error(),
})?;
}
.into());
}
_ => (),
}

View file

@ -102,7 +102,7 @@ fn example_main() -> Result<(), Error> {
match msg.view() {
MessageView::Eos(..) => break,
MessageView::Error(err) => {
Err(ErrorMessage {
return Err(ErrorMessage {
src: err
.get_src()
.map(|s| s.get_path_string())
@ -111,8 +111,8 @@ fn example_main() -> Result<(), Error> {
error: err.get_error().description().into(),
debug: Some(err.get_debug().unwrap().to_string()),
cause: err.get_error(),
})?;
break;
}
.into());
}
_ => (),
}

View file

@ -168,7 +168,7 @@ fn example_main() -> Result<(), Error> {
MessageView::Error(err) => {
pipeline.set_state(gst::State::Null)?;
Err(ErrorMessage {
return Err(ErrorMessage {
src: msg
.get_src()
.map(|s| String::from(s.get_path_string()))
@ -176,8 +176,8 @@ fn example_main() -> Result<(), Error> {
error: err.get_error().description().into(),
debug: Some(err.get_debug().unwrap().to_string()),
cause: err.get_error(),
})?;
break;
}
.into());
}
MessageView::StateChanged(s) => {
println!(