mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-01-21 06:28:11 +00:00
Change Structure/StructureRef to_string() to the minimal required fix
And add a comment to why we need it. No other struct with a to_string() function is affected. https://github.com/sdroege/gstreamer-rs/issues/101
This commit is contained in:
parent
9427e75fa4
commit
6868eddcb6
1 changed files with 6 additions and 6 deletions
|
@ -116,15 +116,15 @@ impl Drop for Structure {
|
||||||
|
|
||||||
impl fmt::Debug for Structure {
|
impl fmt::Debug for Structure {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
f.debug_tuple("Structure")
|
f.debug_tuple("Structure").field(&self.to_string()).finish()
|
||||||
.field(&self.as_ref().to_string())
|
|
||||||
.finish()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Display for Structure {
|
impl fmt::Display for Structure {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
f.write_str(&self.as_ref().to_string())
|
// Need to make sure to not call ToString::to_string() here, which
|
||||||
|
// we have because of the Display impl. We need StructureRef::to_string()
|
||||||
|
f.write_str(&StructureRef::to_string(self.as_ref()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -487,13 +487,13 @@ impl StructureRef {
|
||||||
|
|
||||||
impl fmt::Display for StructureRef {
|
impl fmt::Display for StructureRef {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
f.write_str(&StructureRef::to_string(self))
|
f.write_str(&self.to_string())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Debug for StructureRef {
|
impl fmt::Debug for StructureRef {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
f.write_str(&StructureRef::to_string(self))
|
f.write_str(&self.to_string())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue