mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-25 19:11:06 +00:00
Replace Result<(), fmt::Error> with fmt::Result
This commit is contained in:
parent
9f0befa033
commit
2447664df6
13 changed files with 21 additions and 21 deletions
|
@ -157,7 +157,7 @@ impl str::FromStr for crate::AudioFormat {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Display for crate::AudioFormat {
|
impl fmt::Display for crate::AudioFormat {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
f.write_str((*self).to_str())
|
f.write_str((*self).to_str())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -269,7 +269,7 @@ impl Ord for AudioFormatInfo {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Debug for AudioFormatInfo {
|
impl fmt::Debug for AudioFormatInfo {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
f.debug_struct("AudioFormatInfo")
|
f.debug_struct("AudioFormatInfo")
|
||||||
.field("format", &self.format())
|
.field("format", &self.format())
|
||||||
.field("name", &self.name())
|
.field("name", &self.name())
|
||||||
|
@ -284,7 +284,7 @@ impl fmt::Debug for AudioFormatInfo {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Display for AudioFormatInfo {
|
impl fmt::Display for AudioFormatInfo {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
f.write_str(self.name())
|
f.write_str(self.name())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ use std::ptr;
|
||||||
pub struct AudioInfo(ffi::GstAudioInfo, [crate::AudioChannelPosition; 64]);
|
pub struct AudioInfo(ffi::GstAudioInfo, [crate::AudioChannelPosition; 64]);
|
||||||
|
|
||||||
impl fmt::Debug for AudioInfo {
|
impl fmt::Debug for AudioInfo {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
f.debug_struct("AudioInfo")
|
f.debug_struct("AudioInfo")
|
||||||
.field("format-info", &self.format_info())
|
.field("format-info", &self.format_info())
|
||||||
.field("rate", &self.rate())
|
.field("rate", &self.rate())
|
||||||
|
|
|
@ -91,7 +91,7 @@ unsafe impl Send for AudioRingBufferSpec {}
|
||||||
unsafe impl Sync for AudioRingBufferSpec {}
|
unsafe impl Sync for AudioRingBufferSpec {}
|
||||||
|
|
||||||
impl fmt::Debug for AudioRingBufferSpec {
|
impl fmt::Debug for AudioRingBufferSpec {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
f.debug_struct("AudioRingBufferSpec")
|
f.debug_struct("AudioRingBufferSpec")
|
||||||
.field("type", &self.get_type())
|
.field("type", &self.get_type())
|
||||||
.field("caps", &self.get_caps())
|
.field("caps", &self.get_caps())
|
||||||
|
|
|
@ -70,7 +70,7 @@ impl<'a> ::glib::translate::ToGlibPtr<'a, *mut ffi::GstBaseParseFrame> for BaseP
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> fmt::Debug for BaseParseFrame<'a> {
|
impl<'a> fmt::Debug for BaseParseFrame<'a> {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
let mut b = f.debug_struct("BaseParseFrame");
|
let mut b = f.debug_struct("BaseParseFrame");
|
||||||
|
|
||||||
b.field("buffer", &self.get_buffer())
|
b.field("buffer", &self.get_buffer())
|
||||||
|
|
|
@ -34,7 +34,7 @@ impl<'a> ::glib::translate::ToGlibPtr<'a, *mut ffi::GstVideoCodecFrame> for Vide
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> fmt::Debug for VideoCodecFrame<'a> {
|
impl<'a> fmt::Debug for VideoCodecFrame<'a> {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
let mut b = f.debug_struct("VideoCodecFrame");
|
let mut b = f.debug_struct("VideoCodecFrame");
|
||||||
|
|
||||||
b.field("flags", &self.get_flags())
|
b.field("flags", &self.get_flags())
|
||||||
|
|
|
@ -54,7 +54,7 @@ pub struct VideoCodecState<'a, T: VideoCodecStateContext<'a>> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, T: VideoCodecStateContext<'a>> fmt::Debug for VideoCodecState<'a, T> {
|
impl<'a, T: VideoCodecStateContext<'a>> fmt::Debug for VideoCodecState<'a, T> {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
f.debug_struct("VideoCodecState")
|
f.debug_struct("VideoCodecState")
|
||||||
.field("info", &self.get_info())
|
.field("info", &self.get_info())
|
||||||
.field("caps", &self.get_caps())
|
.field("caps", &self.get_caps())
|
||||||
|
|
|
@ -359,7 +359,7 @@ impl str::FromStr for crate::VideoFormat {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Display for crate::VideoFormat {
|
impl fmt::Display for crate::VideoFormat {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
f.write_str((*self).to_str())
|
f.write_str((*self).to_str())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -397,7 +397,7 @@ impl Ord for VideoFormatInfo {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Debug for VideoFormatInfo {
|
impl fmt::Debug for VideoFormatInfo {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
f.debug_struct("VideoFormatInfo")
|
f.debug_struct("VideoFormatInfo")
|
||||||
.field("format", &self.format())
|
.field("format", &self.format())
|
||||||
.field("name", &self.name())
|
.field("name", &self.name())
|
||||||
|
@ -423,7 +423,7 @@ impl fmt::Debug for VideoFormatInfo {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Display for VideoFormatInfo {
|
impl fmt::Display for VideoFormatInfo {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
f.write_str(self.name())
|
f.write_str(self.name())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -158,7 +158,7 @@ impl str::FromStr for crate::VideoColorimetry {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Debug for crate::VideoColorimetry {
|
impl fmt::Debug for crate::VideoColorimetry {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
f.debug_struct("VideoColorimetry")
|
f.debug_struct("VideoColorimetry")
|
||||||
.field("range", &self.0.range)
|
.field("range", &self.0.range)
|
||||||
.field("matrix", &self.0.matrix)
|
.field("matrix", &self.0.matrix)
|
||||||
|
@ -169,7 +169,7 @@ impl fmt::Debug for crate::VideoColorimetry {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Display for crate::VideoColorimetry {
|
impl fmt::Display for crate::VideoColorimetry {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
let s =
|
let s =
|
||||||
unsafe { glib::GString::from_glib_full(ffi::gst_video_colorimetry_to_string(&self.0)) };
|
unsafe { glib::GString::from_glib_full(ffi::gst_video_colorimetry_to_string(&self.0)) };
|
||||||
f.write_str(&s)
|
f.write_str(&s)
|
||||||
|
@ -194,7 +194,7 @@ impl str::FromStr for crate::VideoChromaSite {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Display for crate::VideoChromaSite {
|
impl fmt::Display for crate::VideoChromaSite {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
let s = unsafe {
|
let s = unsafe {
|
||||||
glib::GString::from_glib_full(ffi::gst_video_chroma_to_string(self.to_glib()))
|
glib::GString::from_glib_full(ffi::gst_video_chroma_to_string(self.to_glib()))
|
||||||
};
|
};
|
||||||
|
@ -320,7 +320,7 @@ impl std::convert::TryFrom<crate::VideoMultiviewMode> for crate::VideoMultiviewF
|
||||||
pub struct VideoInfo(pub(crate) ffi::GstVideoInfo);
|
pub struct VideoInfo(pub(crate) ffi::GstVideoInfo);
|
||||||
|
|
||||||
impl fmt::Debug for VideoInfo {
|
impl fmt::Debug for VideoInfo {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
let mut b = f.debug_struct("VideoInfo");
|
let mut b = f.debug_struct("VideoInfo");
|
||||||
|
|
||||||
b.field("format", &self.format())
|
b.field("format", &self.format())
|
||||||
|
@ -1048,7 +1048,7 @@ impl str::FromStr for crate::VideoFieldOrder {
|
||||||
#[cfg(any(feature = "v1_12", feature = "dox"))]
|
#[cfg(any(feature = "v1_12", feature = "dox"))]
|
||||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
|
||||||
impl fmt::Display for crate::VideoFieldOrder {
|
impl fmt::Display for crate::VideoFieldOrder {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
f.write_str((*self).to_str())
|
f.write_str((*self).to_str())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1078,7 +1078,7 @@ impl str::FromStr for crate::VideoInterlaceMode {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Display for crate::VideoInterlaceMode {
|
impl fmt::Display for crate::VideoInterlaceMode {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
f.write_str((*self).to_str())
|
f.write_str((*self).to_str())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -314,7 +314,7 @@ macro_rules! generic_impl {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Debug for $name {
|
impl fmt::Debug for $name {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
f.debug_struct(stringify!($name))
|
f.debug_struct(stringify!($name))
|
||||||
.field("fps", &self.get_fps())
|
.field("fps", &self.get_fps())
|
||||||
.field("flags", &self.get_flags())
|
.field("flags", &self.get_flags())
|
||||||
|
|
|
@ -97,7 +97,7 @@ impl Ord for VideoTimeCodeInterval {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Debug for VideoTimeCodeInterval {
|
impl fmt::Debug for VideoTimeCodeInterval {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
f.debug_struct("VideoTimeCodeInterval")
|
f.debug_struct("VideoTimeCodeInterval")
|
||||||
.field("hours", &self.0.hours)
|
.field("hours", &self.0.hours)
|
||||||
.field("minutes", &self.0.minutes)
|
.field("minutes", &self.0.minutes)
|
||||||
|
@ -108,7 +108,7 @@ impl fmt::Debug for VideoTimeCodeInterval {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Display for VideoTimeCodeInterval {
|
impl fmt::Display for VideoTimeCodeInterval {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
write!(
|
write!(
|
||||||
f,
|
f,
|
||||||
"{:02}:{:02}:{:02}:{:02}",
|
"{:02}:{:02}:{:02}:{:02}",
|
||||||
|
|
|
@ -139,7 +139,7 @@ impl_common_ops_for_opt_int!(ClockTime);
|
||||||
|
|
||||||
impl fmt::Display for ClockTime {
|
impl fmt::Display for ClockTime {
|
||||||
#[allow(clippy::many_single_char_names)]
|
#[allow(clippy::many_single_char_names)]
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
let precision = f.precision().unwrap_or(9);
|
let precision = f.precision().unwrap_or(9);
|
||||||
// TODO: Could also check width and pad the hours as needed
|
// TODO: Could also check width and pad the hours as needed
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue