diff --git a/instant-xml/src/lib.rs b/instant-xml/src/lib.rs index 5a8cc66..44c3a52 100644 --- a/instant-xml/src/lib.rs +++ b/instant-xml/src/lib.rs @@ -43,7 +43,7 @@ pub fn from_str<'xml, T: FromXml<'xml>>(input: &'xml str) -> Result { pub fn to_string(value: &(impl ToXml + ?Sized)) -> Result { let mut output = String::new(); - value.serialize(&mut Serializer::new(&mut output))?; + to_writer(value, &mut output)?; Ok(output) }