Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a lifetime to Replacer #776

Closed
wants to merge 1 commit into from

Commits on May 5, 2021

  1. Add a lifetime to Replacer

    The current implementation requires any implementations of `Replacer` be
    valid for all possible lifetimes. However, this is neither required nor
    is it always desirable. For example, a user who wishes to use the
    lifetime of the input text as some part of the return type when
    interacting with these APIs would end up with a closure that is valid
    for one specific lifetime.
    
    A concrete example of where this was problematic was described in
    rust-lang#775
    
    Any future code that does require a `Replacer` which is valid for all
    lifetimes can do so with HRTB:
    
    ```
    where
        for<'a> R: Replacer<'a>
    ```
    
    or `R: Replacer<'_>` in some contexts
    sgrif committed May 5, 2021
    Configuration menu
    Copy the full SHA
    85efefb View commit details
    Browse the repository at this point in the history