gstreamer: caps: make call to to_string() explicit

This one was actually working but better to be safe as it may be
ambigious.
This commit is contained in:
Guillaume Desmottes 2019-06-18 16:33:19 +05:30
parent cd16337874
commit 40d2db7095

View file

@ -509,7 +509,7 @@ impl fmt::Debug for CapsRef {
impl fmt::Display for CapsRef { impl fmt::Display for CapsRef {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str(&self.to_string()) f.write_str(&CapsRef::to_string(self))
} }
} }
@ -652,4 +652,12 @@ mod tests {
.build(); .build();
assert_eq!(caps.to_string(), "foo/bar(foo:bla, foo:baz), int=(int)12"); assert_eq!(caps.to_string(), "foo/bar(foo:bla, foo:baz), int=(int)12");
} }
#[test]
fn test_display() {
::init().unwrap();
let caps = Caps::new_simple("foo/bar", &[]);
format!("{}", caps);
}
} }