From 66a3bca217881fe8eee9a5a898aea4ecb1eb5cf3 Mon Sep 17 00:00:00 2001 From: JohnEndson <165029498+JohnEndson@users.noreply.github.com> Date: Thu, 28 Mar 2024 20:25:05 +0800 Subject: [PATCH] doc: remove repetitive words PR #1179 --- regex-automata/src/dfa/mod.rs | 2 +- regex-automata/src/meta/regex.rs | 4 ++-- regex-automata/src/nfa/thompson/range_trie.rs | 2 +- regex-automata/src/util/alphabet.rs | 2 +- regex-automata/src/util/captures.rs | 4 ++-- regex-automata/src/util/start.rs | 2 +- regex-cli/cmd/generate/fowler.rs | 2 +- regex-lite/src/lib.rs | 4 ++-- regex-syntax/src/ast/mod.rs | 2 +- src/regexset/bytes.rs | 2 +- src/regexset/string.rs | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/regex-automata/src/dfa/mod.rs b/regex-automata/src/dfa/mod.rs index fd58cac23..0e6a968e3 100644 --- a/regex-automata/src/dfa/mod.rs +++ b/regex-automata/src/dfa/mod.rs @@ -190,7 +190,7 @@ assert_eq!(matches, vec![ ``` Note that unlike dense DFAs, sparse DFAs have no alignment requirements. -Conversely, dense DFAs must be be aligned to the same alignment as a +Conversely, dense DFAs must be aligned to the same alignment as a [`StateID`](crate::util::primitives::StateID). # Support for `no_std` and `alloc`-only diff --git a/regex-automata/src/meta/regex.rs b/regex-automata/src/meta/regex.rs index a06d2bb48..8cfdecbec 100644 --- a/regex-automata/src/meta/regex.rs +++ b/regex-automata/src/meta/regex.rs @@ -1826,7 +1826,7 @@ impl Regex { /// /// The precise meaning of "accelerated" is specifically left unspecified, /// but the general meaning is that the search is a high likelihood of - /// running faster than than a character-at-a-time loop inside a standard + /// running faster than a character-at-a-time loop inside a standard /// regex engine. /// /// When a regex is accelerated, it is only a *probabilistic* claim. That @@ -2282,7 +2282,7 @@ impl<'r, 'h> core::iter::FusedIterator for SplitN<'r, 'h> {} /// /// Most of the regex engines in this crate require some kind of /// mutable state in order to execute a search. This mutable state is -/// explicitly separated from the the core regex object (such as a +/// explicitly separated from the core regex object (such as a /// [`thompson::NFA`](crate::nfa::thompson::NFA)) so that the read-only regex /// object can be shared across multiple threads simultaneously without any /// synchronization. Conversely, a `Cache` must either be duplicated if using diff --git a/regex-automata/src/nfa/thompson/range_trie.rs b/regex-automata/src/nfa/thompson/range_trie.rs index 49debda40..93cce1699 100644 --- a/regex-automata/src/nfa/thompson/range_trie.rs +++ b/regex-automata/src/nfa/thompson/range_trie.rs @@ -693,7 +693,7 @@ impl NextInsert { /// handle: /// /// 1. The part where the two ranges actually overlap. i.e., The intersection. -/// 2. The part of the existing range that is not in the the new range. +/// 2. The part of the existing range that is not in the new range. /// 3. The part of the new range that is not in the old range. /// /// (1) is guaranteed to always occur since all overlapping ranges have a diff --git a/regex-automata/src/util/alphabet.rs b/regex-automata/src/util/alphabet.rs index 22b5a7644..e0e4d2fc1 100644 --- a/regex-automata/src/util/alphabet.rs +++ b/regex-automata/src/util/alphabet.rs @@ -699,7 +699,7 @@ impl ByteClassSet { ByteClassSet(ByteSet::empty()) } - /// Indicate the the range of byte given (inclusive) can discriminate a + /// Indicate the range of byte given (inclusive) can discriminate a /// match between it and all other bytes outside of the range. pub(crate) fn set_range(&mut self, start: u8, end: u8) { debug_assert!(start <= end); diff --git a/regex-automata/src/util/captures.rs b/regex-automata/src/util/captures.rs index 05db6a993..93a0a8afa 100644 --- a/regex-automata/src/util/captures.rs +++ b/regex-automata/src/util/captures.rs @@ -1643,7 +1643,7 @@ impl GroupInfo { /// /// This also returns `None` for all inputs if these captures are empty /// (e.g., built from an empty [`GroupInfo`]). To check whether captures - /// are are present for a specific pattern, use [`GroupInfo::group_len`]. + /// are present for a specific pattern, use [`GroupInfo::group_len`]. /// /// # Example /// @@ -1695,7 +1695,7 @@ impl GroupInfo { /// /// This also returns `None` for all inputs if these captures are empty /// (e.g., built from an empty [`GroupInfo`]). To check whether captures - /// are are present for a specific pattern, use [`GroupInfo::group_len`]. + /// are present for a specific pattern, use [`GroupInfo::group_len`]. /// /// # Example /// diff --git a/regex-automata/src/util/start.rs b/regex-automata/src/util/start.rs index 27153780e..97988b44b 100644 --- a/regex-automata/src/util/start.rs +++ b/regex-automata/src/util/start.rs @@ -323,7 +323,7 @@ impl core::fmt::Debug for StartByteMap { /// Represents the six possible starting configurations of a DFA search. /// -/// The starting configuration is determined by inspecting the the beginning +/// The starting configuration is determined by inspecting the beginning /// of the haystack (up to 1 byte). Ultimately, this along with a pattern ID /// (if specified) and the type of search (anchored or not) is what selects the /// start state to use in a DFA. diff --git a/regex-cli/cmd/generate/fowler.rs b/regex-cli/cmd/generate/fowler.rs index c287f6f52..404c47721 100644 --- a/regex-cli/cmd/generate/fowler.rs +++ b/regex-cli/cmd/generate/fowler.rs @@ -178,7 +178,7 @@ impl TomlTest { // this trade off (to this extent anyway), so it really wants all // capturing groups... // - // So what we do here is is look for the number of groups in the + // So what we do here is look for the number of groups in the // pattern and then just pad out the capture matches with None // values to make the number of capture matches equal to what we // would expect from the pattern. (We actually parse the regex to diff --git a/regex-lite/src/lib.rs b/regex-lite/src/lib.rs index 9b394a480..0aca8221d 100644 --- a/regex-lite/src/lib.rs +++ b/regex-lite/src/lib.rs @@ -257,7 +257,7 @@ let dates: Vec<(&str, &str, &str)> = re.captures_iter(hay).map(|caps| { // regex matches, and in this context, we know we have a match. // // Note that we use `caps.name("y").unwrap().as_str()` instead of - // `&caps["y"]` because the the lifetime of the former is the same as the + // `&caps["y"]` because the lifetime of the former is the same as the // lifetime of `hay` above, but the lifetime of the latter is tied to the // lifetime of `caps` due to how the `Index` trait is defined. let year = caps.name("y").unwrap().as_str(); @@ -821,7 +821,7 @@ it, a longer haystack will take more time to search. * Very large regexes can searches to be quite slow due to increasing the size `m` in the worst case `O(m * n)` bound. This is especially true when they are combined with counted repetitions. While the regex size limit above will -protect you from the most egregious cases, the the default size limit still +protect you from the most egregious cases, the default size limit still permits pretty big regexes that can execute more slowly than one might expect. * While routines like [`Regex::find`] and [`Regex::captures`] guarantee worst case `O(m * n)` search time, routines like [`Regex::find_iter`] and diff --git a/regex-syntax/src/ast/mod.rs b/regex-syntax/src/ast/mod.rs index 6a77ee134..ce79a89ab 100644 --- a/regex-syntax/src/ast/mod.rs +++ b/regex-syntax/src/ast/mod.rs @@ -711,7 +711,7 @@ pub enum LiteralKind { /// The literal is written as an octal escape, e.g., `\141`. Octal, /// The literal is written as a hex code with a fixed number of digits - /// depending on the type of the escape, e.g., `\x61` or or `\u0061` or + /// depending on the type of the escape, e.g., `\x61` or `\u0061` or /// `\U00000061`. HexFixed(HexLiteralKind), /// The literal is written as a hex code with a bracketed number of diff --git a/src/regexset/bytes.rs b/src/regexset/bytes.rs index 1220a1466..2f46abc4d 100644 --- a/src/regexset/bytes.rs +++ b/src/regexset/bytes.rs @@ -355,7 +355,7 @@ impl RegexSet { ) -> bool { // This is pretty dumb. We should try to fix this, but the // regex-automata API doesn't provide a way to store matches in an - // arbitrary &mut [bool]. Thankfully, this API is is doc(hidden) and + // arbitrary &mut [bool]. Thankfully, this API is doc(hidden) and // thus not public... But regex-capi currently uses it. We should // fix regex-capi to use a PatternSet, maybe? Not sure... PatternSet // is in regex-automata, not regex. So maybe we should just accept a diff --git a/src/regexset/string.rs b/src/regexset/string.rs index 2a3e7b802..5cb9b5608 100644 --- a/src/regexset/string.rs +++ b/src/regexset/string.rs @@ -351,7 +351,7 @@ impl RegexSet { ) -> bool { // This is pretty dumb. We should try to fix this, but the // regex-automata API doesn't provide a way to store matches in an - // arbitrary &mut [bool]. Thankfully, this API is is doc(hidden) and + // arbitrary &mut [bool]. Thankfully, this API is doc(hidden) and // thus not public... But regex-capi currently uses it. We should // fix regex-capi to use a PatternSet, maybe? Not sure... PatternSet // is in regex-automata, not regex. So maybe we should just accept a