diff --git a/src/elements/mi/mod.rs b/src/elements/mi/mod.rs index 6d180d5..45a14b4 100644 --- a/src/elements/mi/mod.rs +++ b/src/elements/mi/mod.rs @@ -56,7 +56,7 @@ pub struct IdentBuilder { impl IdentBuilder { /// Set the identifier string for the [`Ident`] element. - pub fn ident(self, ident: impl Into) -> IdentBuilder { + pub fn ident(self, ident: impl Into) -> IdentBuilder { IdentBuilder { ident: Some(ident.into()), attributes: self.attributes, diff --git a/src/lib.rs b/src/lib.rs index 3bf8ce6..18c94fc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -125,9 +125,12 @@ impl MathMl { } /// Write this `math` element and its children using the given writer. - pub fn write(&self, writer: &mut W) -> Result { + pub fn write<'writer, W: Writer>( + &self, + writer: &'writer mut W, + ) -> Result<&'writer mut W, W::Error> { writer.write_mathml(self)?; - Ok(writer.finish()) + Ok(writer) } /// Render this `math` element and its children using the default renderer. @@ -135,6 +138,7 @@ impl MathMl { /// In this implementation, [`BufMathMlWriter`] is used. pub fn render(&self) -> Result::Error> { self.write(&mut BufMathMlWriter::default()) + .map(|w| w.finish()) } }