From 0e3485b3298c9670c7efe432f11a01823da4c34d Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Mon, 2 Jan 2017 10:45:24 -0500 Subject: [PATCH 1/2] Use `'t` lifetime for NoExpand. This brings the code into sync with the docs. Fixes #312 --- src/re_bytes.rs | 4 ++-- src/re_unicode.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/re_bytes.rs b/src/re_bytes.rs index ffc659cab6..5d70afb223 100644 --- a/src/re_bytes.rs +++ b/src/re_bytes.rs @@ -991,9 +991,9 @@ impl Replacer for F where F: FnMut(&Captures) -> Vec { /// and performant (since capture groups don't need to be found). /// /// `'t` is the lifetime of the literal text. -pub struct NoExpand<'r>(pub &'r [u8]); +pub struct NoExpand<'t>(pub &'t [u8]); -impl<'a> Replacer for NoExpand<'a> { +impl<'t> Replacer for NoExpand<'t> { fn replace_append(&mut self, _: &Captures, dst: &mut Vec) { dst.extend_from_slice(self.0); } diff --git a/src/re_unicode.rs b/src/re_unicode.rs index 4cc55235ed..dc60044809 100644 --- a/src/re_unicode.rs +++ b/src/re_unicode.rs @@ -1190,9 +1190,9 @@ impl Replacer for F where F: FnMut(&Captures) -> String { /// and performant (since capture groups don't need to be found). /// /// `'t` is the lifetime of the literal text. -pub struct NoExpand<'r>(pub &'r str); +pub struct NoExpand<'t>(pub &'t str); -impl<'a> Replacer for NoExpand<'a> { +impl<'t> Replacer for NoExpand<'t> { fn replace_append(&mut self, _: &Captures, dst: &mut String) { dst.push_str(self.0); } From c4d7fa94c6dcc13264167a8b487f34072465c12f Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Mon, 2 Jan 2017 10:45:45 -0500 Subject: [PATCH 2/2] Add compile->build rename breaking change to CHANGELOG. Fixes #316 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c7ecfcfe4..b45a27950a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,7 @@ Breaking changes for the regex API: * The `RegexBuilder` type has switched from owned `self` method receivers to `&mut self` method receivers. Most uses will continue to work unchanged, but some code may require naming an intermediate variable to hold the builder. +* The `compile` method on `RegexBuilder` has been renamed to `build`. * The free `is_match` function has been removed. It is replaced by compiling a `Regex` and calling its `is_match` method. * The `PartialEq` and `Eq` impls on `Regex` have been dropped. If you relied