diff --git a/src/events/attributes.rs b/src/events/attributes.rs index 5f08b820..081e93e8 100644 --- a/src/events/attributes.rs +++ b/src/events/attributes.rs @@ -92,7 +92,7 @@ impl<'a> Attribute<'a> { /// This will allocate if the value contains any escape sequences. /// /// See also [`unescaped_value_with_custom_entities()`](#method.unescaped_value_with_custom_entities) - pub fn unescaped_value(&self) -> Result> { + pub fn unescaped_value(&self) -> Result> { self.make_unescaped_value(None) } @@ -112,14 +112,14 @@ impl<'a> Attribute<'a> { pub fn unescaped_value_with_custom_entities( &self, custom_entities: &HashMap, Vec>, - ) -> Result> { + ) -> Result> { self.make_unescaped_value(Some(custom_entities)) } fn make_unescaped_value( &self, custom_entities: Option<&HashMap, Vec>>, - ) -> Result> { + ) -> Result> { do_unescape(&self.value, custom_entities).map_err(Error::EscapeError) } diff --git a/src/events/mod.rs b/src/events/mod.rs index ee3d7ee8..5e598bd2 100644 --- a/src/events/mod.rs +++ b/src/events/mod.rs @@ -191,7 +191,7 @@ impl<'a> BytesStart<'a> { /// /// See also [`unescaped_with_custom_entities()`](#method.unescaped_with_custom_entities) #[inline] - pub fn unescaped(&self) -> Result> { + pub fn unescaped(&self) -> Result> { self.make_unescaped(None) } @@ -207,18 +207,18 @@ impl<'a> BytesStart<'a> { /// /// See also [`unescaped()`](#method.unescaped) #[inline] - pub fn unescaped_with_custom_entities<'s>( - &'s self, + pub fn unescaped_with_custom_entities( + &self, custom_entities: &HashMap, Vec>, - ) -> Result> { + ) -> Result> { self.make_unescaped(Some(custom_entities)) } #[inline] - fn make_unescaped<'s>( - &'s self, + fn make_unescaped( + &self, custom_entities: Option<&HashMap, Vec>>, - ) -> Result> { + ) -> Result> { do_unescape(&self.buf, custom_entities).map_err(Error::EscapeError) } @@ -618,7 +618,7 @@ impl<'a> BytesText<'a> { /// returns Malformed error with index within element if '&' is not followed by ';' /// /// See also [`unescaped_with_custom_entities()`](#method.unescaped_with_custom_entities) - pub fn unescaped(&self) -> Result> { + pub fn unescaped(&self) -> Result> { self.make_unescaped(None) } @@ -633,17 +633,17 @@ impl<'a> BytesText<'a> { /// The keys and values of `custom_entities`, if any, must be valid UTF-8. /// /// See also [`unescaped()`](#method.unescaped) - pub fn unescaped_with_custom_entities<'s>( - &'s self, + pub fn unescaped_with_custom_entities( + &self, custom_entities: &HashMap, Vec>, - ) -> Result> { + ) -> Result> { self.make_unescaped(Some(custom_entities)) } - fn make_unescaped<'s>( - &'s self, + fn make_unescaped( + &self, custom_entities: Option<&HashMap, Vec>>, - ) -> Result> { + ) -> Result> { do_unescape(&self.content, custom_entities).map_err(Error::EscapeError) }