mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-09-27 14:30:36 +00:00
ce98a4755e
It is annoying to see only a single line of error when debugging a chain of (e.g. `anyhow::Context::context()`-created) errors, and have a zero exit-code while at it. Instead Rust supports returning a `Result` type straight from main which is `Debug`- instead of `Display`-printed, so that - in the case of `anyhow::Error` - all nested (via `.source()`) `Error`s are printed in backtrace-like form, and the exit code is appropriately non-zero. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1336>
18 lines
330 B
Rust
18 lines
330 B
Rust
#![allow(clippy::non_send_fields_in_send_ty)]
|
|
|
|
use anyhow::Result;
|
|
|
|
#[path = "../glupload.rs"]
|
|
mod glupload;
|
|
use glupload::*;
|
|
|
|
#[path = "../examples-common.rs"]
|
|
pub mod examples_common;
|
|
|
|
fn example_main() -> Result<()> {
|
|
App::new(None).and_then(main_loop)
|
|
}
|
|
|
|
fn main() -> Result<()> {
|
|
examples_common::run(example_main)
|
|
}
|