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
More generic impl of Replacer for closures #1048
Commits on Jul 20, 2023
-
More generic impl of Replacer for closures
Implement `Replacer` also for closures that return a type which depends on lifetime of the argument. This allows performing a no-op replacement where the closure returns the whole match, for example, without needing to clone the captured string.
Configuration menu - View commit details
-
Copy full SHA for f73db82 - Browse repository at this point
Copy the full SHA f73db82View commit details -
fixup! More generic impl of Replacer for closures
Fixed code formatting using rustfmt.
Configuration menu - View commit details
-
Copy full SHA for b6a612d - Browse repository at this point
Copy the full SHA b6a612dView commit details -
fixup! More generic impl of Replacer for closures
Less generic implementation, which results in a better documented API.
Configuration menu - View commit details
-
Copy full SHA for 092b770 - Browse repository at this point
Copy the full SHA 092b770View commit details -
fixup! More generic impl of Replacer for closures
Do not use the same lifetime for reference and type parameter of `Captures`.
Configuration menu - View commit details
-
Copy full SHA for adf66a8 - Browse repository at this point
Copy the full SHA adf66a8View commit details -
fixup! More generic impl of Replacer for closures
Hide `ReplacerClosure` trait as an implementation detail and describe for which closures the `Replacer` trait is implemented in the documentation instead. Added documentation tests.
Configuration menu - View commit details
-
Copy full SHA for a40d8f5 - Browse repository at this point
Copy the full SHA a40d8f5View commit details -
fixup! More generic impl of Replacer for closures
Fixed error in documentation comment in private module.
Configuration menu - View commit details
-
Copy full SHA for de48780 - Browse repository at this point
Copy the full SHA de48780View commit details -
fixup! More generic impl of Replacer for closures
Ignore documentation test that needs unstable Rust.
Configuration menu - View commit details
-
Copy full SHA for 4451505 - Browse repository at this point
Copy the full SHA 4451505View commit details -
fixup! More generic impl of Replacer for closures
Do not use closure lifetime binder but helper function for coercion in documentation test.
Configuration menu - View commit details
-
Copy full SHA for 43222f2 - Browse repository at this point
Copy the full SHA 43222f2View commit details -
fixup! More generic impl of Replacer for closures
Added documentation comment on `Replacer` impl for closures.
Configuration menu - View commit details
-
Copy full SHA for 2c8c8dd - Browse repository at this point
Copy the full SHA 2c8c8ddView commit details
Commits on Jul 21, 2023
-
fixup! More generic impl of Replacer for closures
Removed unnecessary import of `Replacer` in doc test.
Configuration menu - View commit details
-
Copy full SHA for 657dab8 - Browse repository at this point
Copy the full SHA 657dab8View commit details -
fixup! More generic impl of Replacer for closures
Use same lifetime for reference and type parameter of `Captures` (again) because `Captures<'a>` is covariant over `'a`. This covers closures that accept a `&'a Captures<'b>` as argument and have a result type that depends either on `'b` or `'a`. Documentation was updated and corresponding test cases have been added to `tests/misc.rs`. A link to the blanket implementation has been added to the "Implementation by closures" section of the documentation on `Replacer`.
Configuration menu - View commit details
-
Copy full SHA for 664a0f2 - Browse repository at this point
Copy the full SHA 664a0f2View commit details
Commits on Jul 22, 2023
-
fixup! More generic impl of Replacer for closures
Refactored code to be able to use two different lifetimes `'a` and `'b` for the `&'a Captures<'b>` argument while allowing the return type to depend on either `'a` or `'b`.
Configuration menu - View commit details
-
Copy full SHA for d89b31a - Browse repository at this point
Copy the full SHA d89b31aView commit details -
fixup! More generic impl of Replacer for closures
Do not mention unstable features in documentation. Do not include coercing helper function in example code.
Configuration menu - View commit details
-
Copy full SHA for 1aab0b8 - Browse repository at this point
Copy the full SHA 1aab0b8View commit details