From 94ace068837aeb995ec43d95f9058d9b12f507ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sat, 11 Apr 2020 19:39:04 +0300 Subject: [PATCH] Remove deprecated std::error::Error::description() impls --- gstreamer-pbutils/src/encoding_profile.rs | 10 +--------- gstreamer/src/format.rs | 12 ++---------- gstreamer/src/structure.rs | 6 +----- 3 files changed, 4 insertions(+), 24 deletions(-) diff --git a/gstreamer-pbutils/src/encoding_profile.rs b/gstreamer-pbutils/src/encoding_profile.rs index 8ddb6e27e..f2a071d1d 100644 --- a/gstreamer-pbutils/src/encoding_profile.rs +++ b/gstreamer-pbutils/src/encoding_profile.rs @@ -266,15 +266,7 @@ impl fmt::Display for EncodingProfileBuilderError { } } -impl error::Error for EncodingProfileBuilderError { - fn description(&self) -> &str { - "invalid parameters to build encoding profile" - } - - fn cause(&self) -> Option<&dyn error::Error> { - None - } -} +impl error::Error for EncodingProfileBuilderError {} #[derive(Debug)] struct EncodingProfileBuilderCommonData<'a> { diff --git a/gstreamer/src/format.rs b/gstreamer/src/format.rs index 451d15066..c4e2fbfbd 100644 --- a/gstreamer/src/format.rs +++ b/gstreamer/src/format.rs @@ -39,11 +39,7 @@ pub struct Percent(pub Option); #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub struct TryFromGenericFormattedValueError(()); -impl std::error::Error for TryFromGenericFormattedValueError { - fn description(&self) -> &str { - "invalid generic value format" - } -} +impl std::error::Error for TryFromGenericFormattedValueError {} impl std::fmt::Display for TryFromGenericFormattedValueError { fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result { @@ -667,11 +663,7 @@ impl AsMut> for Percent { #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub struct TryPercentFromFloatError(()); -impl std::error::Error for TryPercentFromFloatError { - fn description(&self) -> &str { - "value out of range" - } -} +impl std::error::Error for TryPercentFromFloatError {} impl std::fmt::Display for TryPercentFromFloatError { fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result { diff --git a/gstreamer/src/structure.rs b/gstreamer/src/structure.rs index 2a0b5f861..9ba834529 100644 --- a/gstreamer/src/structure.rs +++ b/gstreamer/src/structure.rs @@ -73,11 +73,7 @@ impl<'name> fmt::Display for GetError<'name> { } } -impl<'name> error::Error for GetError<'name> { - fn description(&self) -> &str { - "GetError: Structure field value" - } -} +impl<'name> error::Error for GetError<'name> {} pub struct Structure(ptr::NonNull, PhantomData); unsafe impl Send for Structure {}