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
While right now the main handlers can borrow data from the surrounding scope on_end_tag can't. This means that the data needs to be copped, put into an Rc or similar. Since IIUC this handler is not stored past the lifetime of the rewriter it would be nice if the lifetime reflected that.
Alternatively add an element_end handler to ElementContentHandlers as those handlers have the expected lifetime, this would also reduce allocations as the handler only needs to be allocated once instead of for each element.
I think the ideal state would be to replace ElementContentHandlers with a trait that could be implemented as it is basically a strange trait right now (you just need to "define" methods at runtime rather than implementing a trait). It would probably be possible to swap it out for a trait while maintaining the current API for most uses. But that is a bigger change and would probably need a new API to avoid breaking existing users (but the old API could just map to the new one).
The text was updated successfully, but these errors were encountered:
While right now the main handlers can borrow data from the surrounding scope
on_end_tag
can't. This means that the data needs to be copped, put into an Rc or similar. Since IIUC this handler is not stored past the lifetime of the rewriter it would be nice if the lifetime reflected that.Alternatively add an
element_end
handler toElementContentHandlers
as those handlers have the expected lifetime, this would also reduce allocations as the handler only needs to be allocated once instead of for each element.I think the ideal state would be to replace
ElementContentHandlers
with a trait that could be implemented as it is basically a strange trait right now (you just need to "define" methods at runtime rather than implementing a trait). It would probably be possible to swap it out for a trait while maintaining the current API for most uses. But that is a bigger change and would probably need a new API to avoid breaking existing users (but the old API could just map to the new one).The text was updated successfully, but these errors were encountered: