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
In #484 the change made the callback require 'static lifetime, because Arc has an implicit + 'static bound.
This means that closures which borrow from their environment are forbidden now, and must be made to own all of their state. This is especially difficult to use comrak in methods that take &self and need to call self.some_lookup_method() when fixing links.
The same problem still exists when implementing the BrokenLinkCallback trait, since Arc<dyn BrokenLinkCallback> is always going to require 'static for every implementation.
I suggest changing it to Arc<dyn BrokenLinkCallback + 'c> and restoring the 'c lifetime on options.
The text was updated successfully, but these errors were encountered:
In #484 the change made the callback require
'static
lifetime, becauseArc
has an implicit+ 'static
bound.This means that closures which borrow from their environment are forbidden now, and must be made to own all of their state. This is especially difficult to use
comrak
in methods that take&self
and need to callself.some_lookup_method()
when fixing links.The same problem still exists when implementing the
BrokenLinkCallback
trait, sinceArc<dyn BrokenLinkCallback>
is always going to require'static
for every implementation.I suggest changing it to
Arc<dyn BrokenLinkCallback + 'c>
and restoring the'c
lifetime on options.The text was updated successfully, but these errors were encountered: