Skip to content

Commit cf00423

Browse files
committed
lint: fixes for new lifetime lint
This also tweaks a doc test that failed on 32-bit. It likely always failed, but was only recently surfaced because doc tests previously weren't run when cross compiling.
1 parent 1a069b9 commit cf00423

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

regex-automata/src/nfa/thompson/compiler.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,9 @@ impl Config {
230230
/// # if cfg!(miri) { return Ok(()); } // miri takes too long
231231
/// use regex_automata::nfa::thompson::NFA;
232232
///
233-
/// // 400KB isn't enough!
233+
/// // 300KB isn't enough!
234234
/// NFA::compiler()
235-
/// .configure(NFA::config().nfa_size_limit(Some(400_000)))
235+
/// .configure(NFA::config().nfa_size_limit(Some(300_000)))
236236
/// .build(r"\w{20}")
237237
/// .unwrap_err();
238238
///

regex-automata/src/util/alphabet.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -469,15 +469,15 @@ impl ByteClasses {
469469
/// # Ok::<(), Box<dyn std::error::Error>>(())
470470
/// ```
471471
#[inline]
472-
pub fn elements(&self, class: Unit) -> ByteClassElements {
472+
pub fn elements(&self, class: Unit) -> ByteClassElements<'_> {
473473
ByteClassElements { classes: self, class, byte: 0 }
474474
}
475475

476476
/// Returns an iterator of byte ranges in the given equivalence class.
477477
///
478478
/// That is, a sequence of contiguous ranges are returned. Typically, every
479479
/// class maps to a single contiguous range.
480-
fn element_ranges(&self, class: Unit) -> ByteClassElementRanges {
480+
fn element_ranges(&self, class: Unit) -> ByteClassElementRanges<'_> {
481481
ByteClassElementRanges { elements: self.elements(class), range: None }
482482
}
483483
}
@@ -786,12 +786,12 @@ impl ByteSet {
786786
}
787787

788788
/// Returns an iterator over all bytes in this set.
789-
pub(crate) fn iter(&self) -> ByteSetIter {
789+
pub(crate) fn iter(&self) -> ByteSetIter<'_> {
790790
ByteSetIter { set: self, b: 0 }
791791
}
792792

793793
/// Returns an iterator over all contiguous ranges of bytes in this set.
794-
pub(crate) fn iter_ranges(&self) -> ByteSetRangeIter {
794+
pub(crate) fn iter_ranges(&self) -> ByteSetRangeIter<'_> {
795795
ByteSetRangeIter { set: self, b: 0 }
796796
}
797797

regex-test/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ impl RegexTests {
198198
/// loaded.
199199
///
200200
/// This is useful to pass to [`TestRunner::test_iter`].
201-
pub fn iter(&self) -> RegexTestsIter {
201+
pub fn iter(&self) -> RegexTestsIter<'_> {
202202
RegexTestsIter(self.tests.iter())
203203
}
204204
}

0 commit comments

Comments
 (0)