diff --git a/examples/src/bin/glfilter.rs b/examples/src/bin/glfilter.rs index cd19d409d..1f90c1a9c 100644 --- a/examples/src/bin/glfilter.rs +++ b/examples/src/bin/glfilter.rs @@ -1,5 +1,7 @@ #![allow(clippy::non_send_fields_in_send_ty)] +use anyhow::Result; + #[path = "../glupload.rs"] mod glupload; use glupload::*; @@ -161,14 +163,12 @@ mod mirror { } } -fn example_main() { +fn example_main() -> Result<()> { gst::init().unwrap(); let glfilter = mirror::GLMirrorFilter::new(Some("foo")); - App::new(Some(glfilter.as_ref())) - .and_then(main_loop) - .unwrap_or_else(|e| eprintln!("Error! {e}")) + App::new(Some(glfilter.as_ref())).and_then(main_loop) } -fn main() { - examples_common::run(example_main); +fn main() -> Result<()> { + examples_common::run(example_main) } diff --git a/examples/src/bin/glwindow.rs b/examples/src/bin/glwindow.rs index 8ccaae4b2..6c1b5b144 100644 --- a/examples/src/bin/glwindow.rs +++ b/examples/src/bin/glwindow.rs @@ -1,5 +1,7 @@ #![allow(clippy::non_send_fields_in_send_ty)] +use anyhow::Result; + #[path = "../glupload.rs"] mod glupload; use glupload::*; @@ -7,12 +9,10 @@ use glupload::*; #[path = "../examples-common.rs"] pub mod examples_common; -fn example_main() { - App::new(None) - .and_then(main_loop) - .unwrap_or_else(|e| eprintln!("Error! {e}")) +fn example_main() -> Result<()> { + App::new(None).and_then(main_loop) } -fn main() { - examples_common::run(example_main); +fn main() -> Result<()> { + examples_common::run(example_main) }