examples: Stop using deprecated Error::description()

This commit is contained in:
Sebastian Dröge 2020-03-19 13:31:52 +02:00
parent d0bfdda97f
commit ca6bcf36ab
11 changed files with 11 additions and 26 deletions

View file

@ -21,7 +21,6 @@ extern crate glib;
extern crate byte_slice_cast; extern crate byte_slice_cast;
use byte_slice_cast::*; use byte_slice_cast::*;
use std::error::Error as StdError;
use std::i16; use std::i16;
use std::i32; use std::i32;
@ -167,7 +166,7 @@ fn main_loop(pipeline: gst::Pipeline) -> Result<(), Error> {
.get_src() .get_src()
.map(|s| String::from(s.get_path_string())) .map(|s| String::from(s.get_path_string()))
.unwrap_or_else(|| String::from("None")), .unwrap_or_else(|| String::from("None")),
error: err.get_error().description().into(), error: err.get_error().to_string(),
debug: err.get_debug(), debug: err.get_debug(),
cause: err.get_error(), cause: err.get_error(),
} }

View file

@ -17,8 +17,6 @@ extern crate gstreamer_video as gst_video;
extern crate glib; extern crate glib;
use std::error::Error as StdError;
extern crate failure; extern crate failure;
use failure::Error; use failure::Error;
@ -159,7 +157,7 @@ fn main_loop(pipeline: gst::Pipeline) -> Result<(), Error> {
.get_src() .get_src()
.map(|s| String::from(s.get_path_string())) .map(|s| String::from(s.get_path_string()))
.unwrap_or_else(|| String::from("None")), .unwrap_or_else(|| String::from("None")),
error: err.get_error().description().into(), error: err.get_error().to_string(),
debug: err.get_debug(), debug: err.get_debug(),
cause: err.get_error(), cause: err.get_error(),
} }

View file

@ -39,7 +39,6 @@ extern crate glib;
use glib::subclass::prelude::*; use glib::subclass::prelude::*;
use std::env; use std::env;
use std::error::Error as StdError;
#[cfg(feature = "v1_10")] #[cfg(feature = "v1_10")]
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
@ -273,7 +272,7 @@ fn example_main() -> Result<(), Error> {
.get_src() .get_src()
.map(|s| String::from(s.get_path_string())) .map(|s| String::from(s.get_path_string()))
.unwrap_or_else(|| String::from("None")), .unwrap_or_else(|| String::from("None")),
error: err.get_error().description().into(), error: err.get_error().to_string(),
debug: err.get_debug(), debug: err.get_debug(),
cause: err.get_error(), cause: err.get_error(),
} }

View file

@ -25,7 +25,6 @@ extern crate glib;
use glib::subclass::prelude::*; use glib::subclass::prelude::*;
use std::env; use std::env;
use std::error::Error as StdError;
#[cfg(feature = "v1_10")] #[cfg(feature = "v1_10")]
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
@ -303,7 +302,7 @@ fn example_main() -> Result<(), Error> {
.get_src() .get_src()
.map(|s| String::from(s.get_path_string())) .map(|s| String::from(s.get_path_string()))
.unwrap_or_else(|| String::from("None")), .unwrap_or_else(|| String::from("None")),
error: err.get_error().description().into(), error: err.get_error().to_string(),
debug: err.get_debug(), debug: err.get_debug(),
cause: err.get_error(), cause: err.get_error(),
} }

View file

@ -15,7 +15,6 @@ extern crate gstreamer_video as gst_video;
extern crate glib; extern crate glib;
use std::error::Error as StdError;
use std::ffi::CStr; use std::ffi::CStr;
use std::mem; use std::mem;
use std::ptr; use std::ptr;
@ -593,7 +592,7 @@ impl App {
.get_src() .get_src()
.map(|s| String::from(s.get_path_string())) .map(|s| String::from(s.get_path_string()))
.unwrap_or_else(|| String::from("None")), .unwrap_or_else(|| String::from("None")),
error: err.get_error().description().into(), error: err.get_error().to_string(),
debug: err.get_debug(), debug: err.get_debug(),
cause: err.get_error(), cause: err.get_error(),
} }

View file

@ -22,7 +22,6 @@ extern crate pango;
use pango::prelude::*; use pango::prelude::*;
extern crate pangocairo; extern crate pangocairo;
use std::error::Error as StdError;
use std::ops; use std::ops;
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
@ -254,7 +253,7 @@ fn main_loop(pipeline: gst::Pipeline) -> Result<(), Error> {
.get_src() .get_src()
.map(|s| String::from(s.get_path_string())) .map(|s| String::from(s.get_path_string()))
.unwrap_or_else(|| String::from("None")), .unwrap_or_else(|| String::from("None")),
error: err.get_error().description().into(), error: err.get_error().to_string(),
debug: err.get_debug(), debug: err.get_debug(),
cause: err.get_error(), cause: err.get_error(),
} }

View file

@ -5,7 +5,6 @@ use gst::prelude::*;
extern crate glib; extern crate glib;
use std::env; use std::env;
use std::error::Error as StdError;
#[path = "../examples-common.rs"] #[path = "../examples-common.rs"]
mod examples_common; mod examples_common;
@ -274,7 +273,7 @@ fn example_main() -> Result<(), Error> {
.get_src() .get_src()
.map(|s| String::from(s.get_path_string())) .map(|s| String::from(s.get_path_string()))
.unwrap_or_else(|| String::from("None")), .unwrap_or_else(|| String::from("None")),
error: err.get_error().description().into(), error: err.get_error().to_string(),
debug: err.get_debug(), debug: err.get_debug(),
cause: err.get_error(), cause: err.get_error(),
} }

View file

@ -4,8 +4,6 @@ use gst::prelude::*;
extern crate glib; extern crate glib;
use std::error::Error as StdError;
#[path = "../examples-common.rs"] #[path = "../examples-common.rs"]
mod examples_common; mod examples_common;
@ -197,7 +195,7 @@ fn example_main() -> Result<(), Error> {
.get_src() .get_src()
.map(|s| String::from(s.get_path_string())) .map(|s| String::from(s.get_path_string()))
.unwrap_or_else(|| String::from("None")), .unwrap_or_else(|| String::from("None")),
error: err.get_error().description().into(), error: err.get_error().to_string(),
debug: err.get_debug(), debug: err.get_debug(),
cause: err.get_error(), cause: err.get_error(),
} }

View file

@ -13,8 +13,6 @@ extern crate glib;
extern crate gstreamer as gst; extern crate gstreamer as gst;
use gst::prelude::*; use gst::prelude::*;
use std::error::Error as StdError;
extern crate failure; extern crate failure;
use failure::Error; use failure::Error;
@ -384,7 +382,7 @@ fn main_loop(pipeline: gst::Pipeline) -> Result<(), Error> {
.get_src() .get_src()
.map(|s| String::from(s.get_path_string())) .map(|s| String::from(s.get_path_string()))
.unwrap_or_else(|| String::from("None")), .unwrap_or_else(|| String::from("None")),
error: err.get_error().description().into(), error: err.get_error().to_string(),
debug: err.get_debug(), debug: err.get_debug(),
cause: err.get_error(), cause: err.get_error(),
} }

View file

@ -23,8 +23,6 @@ use gst::prelude::*;
extern crate glib; extern crate glib;
use std::error::Error as StdError;
extern crate failure; extern crate failure;
use failure::Error; use failure::Error;
@ -108,7 +106,7 @@ fn example_main() -> Result<(), Error> {
.map(|s| s.get_path_string()) .map(|s| s.get_path_string())
.unwrap_or_else(|| "None".into()) .unwrap_or_else(|| "None".into())
.to_string(), .to_string(),
error: err.get_error().description().into(), error: err.get_error().to_string(),
debug: err.get_debug(), debug: err.get_debug(),
cause: err.get_error(), cause: err.get_error(),
} }

View file

@ -24,7 +24,6 @@ use gst::prelude::*;
extern crate glib; extern crate glib;
use std::env; use std::env;
use std::error::Error as StdError;
extern crate failure; extern crate failure;
use failure::Error; use failure::Error;
@ -174,7 +173,7 @@ fn example_main() -> Result<(), Error> {
.get_src() .get_src()
.map(|s| String::from(s.get_path_string())) .map(|s| String::from(s.get_path_string()))
.unwrap_or_else(|| String::from("None")), .unwrap_or_else(|| String::from("None")),
error: err.get_error().description().into(), error: err.get_error().to_string(),
debug: err.get_debug(), debug: err.get_debug(),
cause: err.get_error(), cause: err.get_error(),
} }