You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So Attributes has a generic parameter 'a, but it doesn't correspond to the same lifetime of the slice inside the reader. It corresponds to the lifetime of the borrow of the reader itself when the Attributes object was created.
One can easily see that making this change will break the code:
diff --git a/src/events/mod.rs b/src/events/mod.rs
index 5e598bd..861ce7b 100644
--- a/src/events/mod.rs+++ b/src/events/mod.rs@@ -223,12 +223,12 @@ impl<'a> BytesStart<'a> {
}
/// Returns an iterator over the attributes of this tag.
- pub fn attributes(&self) -> Attributes {+ pub fn attributes(&self) -> Attributes<'a> {
Attributes::new(&self.buf, self.name_len)
}
/// Returns an iterator over the HTML-like attributes of this tag (no mandatory quotes or `=`).
- pub fn html_attributes(&self) -> Attributes {+ pub fn html_attributes(&self) -> Attributes<'a> {
Attributes::html(self, self.name_len)
}
I'm working on fixing that using as little as possible reallocations, which would mean having a double lifetime on Attributes.
The text was updated successfully, but these errors were encountered:
So
Attributes
has a generic parameter'a
, but it doesn't correspond to the same lifetime of the slice inside the reader. It corresponds to the lifetime of the borrow of the reader itself when theAttributes
object was created.One can easily see that making this change will break the code:
I'm working on fixing that using as little as possible reallocations, which would mean having a double lifetime on
Attributes
.The text was updated successfully, but these errors were encountered: