mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-26 03:21:03 +00:00
video: fix VideoFormat Display implementation
We were calling the blanket implementation of ToString, which is using Display, rather than our own, resulting in an infinite recursion. Fix #208
This commit is contained in:
parent
856a5a25e8
commit
af65497c39
1 changed files with 13 additions and 1 deletions
|
@ -116,6 +116,18 @@ impl str::FromStr for ::VideoFormat {
|
|||
|
||||
impl fmt::Display for ::VideoFormat {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
||||
f.write_str(self.to_string().as_str())
|
||||
f.write_str(::VideoFormat::to_string(*self))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use gst;
|
||||
|
||||
#[test]
|
||||
fn test_display() {
|
||||
gst::init().unwrap();
|
||||
|
||||
format!("{}", ::VideoFormat::Nv16);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue