Skip to content

Commit 54690c2

Browse files
authored
doc: fix typos
This commit fixes an amazing number of new typos that I introduced in the regex 1.9 release. The typos were found and fixed by the typos-cli tool.[1] [1]: https://crates.io/crates/typos-cli PR #1026
1 parent 7c3463d commit 54690c2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+76
-76
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ More specifically, any ASCII character except for `[0-9A-Za-z<>]` can now be
187187
escaped. Also, a new routine, `is_escapeable_character`, has been added to
188188
`regex-syntax` to query whether a character is escapeable or not.
189189
* [FEATURE #547](https://github.com/rust-lang/regex/issues/547):
190-
Add `Regex::captures_at`. This filles a hole in the API, but doesn't otherwise
190+
Add `Regex::captures_at`. This fills a hole in the API, but doesn't otherwise
191191
introduce any new expressive power.
192192
* [FEATURE #595](https://github.com/rust-lang/regex/issues/595):
193193
Capture group names are now Unicode-aware. They can now begin with either a `_`

regex-automata/src/dfa/automaton.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,7 @@ pub unsafe trait Automaton {
10741074
/// // encoding of any Unicode scalar value except for 'a', 'b' or 'c'.
10751075
/// // That translates to a much more complicated DFA, and also
10761076
/// // inhibits the 'accelerator' optimization that we are trying to
1077-
/// // demostrate in this example.
1077+
/// // demonstrate in this example.
10781078
/// .syntax(syntax::Config::new().unicode(false).utf8(false))
10791079
/// .build("[^abc]+a")?;
10801080
///

regex-automata/src/dfa/dense.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2109,7 +2109,7 @@ impl<T: AsRef<[u32]>> DFA<T> {
21092109
/// let mut buf = vec![0; original_dfa.write_to_len()];
21102110
/// // This is guaranteed to succeed, because the only serialization error
21112111
/// // that can occur is when the provided buffer is too small. But
2112-
/// // write_to_len guarantees a correct sie.
2112+
/// // write_to_len guarantees a correct size.
21132113
/// let written = original_dfa.write_to_native_endian(&mut buf).unwrap();
21142114
/// // But this is not guaranteed to succeed! In particular,
21152115
/// // deserialization requires proper alignment for &[u32], but our buffer
@@ -3336,7 +3336,7 @@ impl<'a> TransitionTable<&'a [u32]> {
33363336
///
33373337
/// # Safety
33383338
///
3339-
/// This routine is not safe because it does not check the valdity of the
3339+
/// This routine is not safe because it does not check the validity of the
33403340
/// transition table itself. In particular, the transition table can be
33413341
/// quite large, so checking its validity can be somewhat expensive. An
33423342
/// invalid transition table is not safe because other code may rely on the
@@ -3929,7 +3929,7 @@ impl<'a> StartTable<&'a [u32]> {
39293929
///
39303930
/// # Safety
39313931
///
3932-
/// This routine is not safe because it does not check the valdity of the
3932+
/// This routine is not safe because it does not check the validity of the
39333933
/// starting state IDs themselves. In particular, the number of starting
39343934
/// IDs can be of variable length, so it's possible that checking their
39353935
/// validity cannot be done in constant time. An invalid starting state

regex-automata/src/dfa/determinize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ impl<'a> Runner<'a> {
539539
}
540540
let state = builder.to_state();
541541
// States use reference counting internally, so we only need to count
542-
// their memroy usage once.
542+
// their memory usage once.
543543
self.memory_usage_state += state.memory_usage();
544544
self.builder_states.push(state.clone());
545545
self.cache.insert(state, id);

regex-automata/src/dfa/minimize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ impl<'a> Minimizer<'a> {
152152

153153
// At this point, we now have a minimal partitioning of states, where
154154
// each partition is an equivalence class of DFA states. Now we need to
155-
// use this partioning to update the DFA to only contain one state for
155+
// use this partitioning to update the DFA to only contain one state for
156156
// each partition.
157157

158158
// Create a map from DFA state ID to the representative ID of the

regex-automata/src/dfa/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
A module for building and searching with determinstic finite automata (DFAs).
2+
A module for building and searching with deterministic finite automata (DFAs).
33
44
Like other modules in this crate, DFAs support a rich regex syntax with Unicode
55
features. DFAs also have extensive options for configuring the best space vs
@@ -267,7 +267,7 @@ the regexes in this module are almost universally slow to compile, especially
267267
when they contain large Unicode character classes. For example, on my system,
268268
compiling `\w{50}` takes about 1 second and almost 15MB of memory! (Compiling
269269
a sparse regex takes about the same time but only uses about 1.2MB of
270-
memory.) Conversly, compiling the same regex without Unicode support, e.g.,
270+
memory.) Conversely, compiling the same regex without Unicode support, e.g.,
271271
`(?-u)\w{50}`, takes under 1 millisecond and about 15KB of memory. For this
272272
reason, you should only use Unicode character classes if you absolutely need
273273
them! (They are enabled by default though.)

regex-automata/src/dfa/regex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ impl<A: Automaton> Regex<A> {
590590
///
591591
/// The type parameters are as follows:
592592
///
593-
/// * `A` represents the type of the underyling DFA that implements the
593+
/// * `A` represents the type of the underlying DFA that implements the
594594
/// [`Automaton`] trait.
595595
///
596596
/// The lifetime parameters are as follows:

regex-automata/src/hybrid/dfa.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use crate::{
3232
},
3333
};
3434

35-
/// The mininum number of states that a lazy DFA's cache size must support.
35+
/// The minimum number of states that a lazy DFA's cache size must support.
3636
///
3737
/// This is checked at time of construction to ensure that at least some small
3838
/// number of states can fit in the given capacity allotment. If we can't fit
@@ -2332,7 +2332,7 @@ impl<'i, 'c> Lazy<'i, 'c> {
23322332
"lazy DFA cache has been cleared {} times, \
23332333
which exceeds the limit of {}, \
23342334
AND its bytes searched per state is less \
2335-
than the configured mininum of {}, \
2335+
than the configured minimum of {}, \
23362336
therefore lazy DFA is giving up \
23372337
(bytes searched since cache clear = {}, \
23382338
number of states = {})",
@@ -2348,7 +2348,7 @@ impl<'i, 'c> Lazy<'i, 'c> {
23482348
"lazy DFA cache has been cleared {} times, \
23492349
which exceeds the limit of {}, \
23502350
AND its bytes searched per state is greater \
2351-
than the configured mininum of {}, \
2351+
than the configured minimum of {}, \
23522352
therefore lazy DFA is continuing! \
23532353
(bytes searched since cache clear = {}, \
23542354
number of states = {})",
@@ -2771,7 +2771,7 @@ enum StateSaver {
27712771
/// is stored in 'Saved' since it may have changed.
27722772
ToSave { id: LazyStateID, state: State },
27732773
/// An ID that of a state that has been persisted through a lazy DFA
2774-
/// cache clearing. The ID recorded here corresonds to an ID that was
2774+
/// cache clearing. The ID recorded here corresponds to an ID that was
27752775
/// once marked as ToSave. The IDs are likely not equivalent even though
27762776
/// the states they point to are.
27772777
Saved(LazyStateID),

regex-automata/src/hybrid/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
A module for building and searching with lazy determinstic finite automata
2+
A module for building and searching with lazy deterministic finite automata
33
(DFAs).
44
55
Like other modules in this crate, lazy DFAs support a rich regex syntax with

regex-automata/src/hybrid/search.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ fn find_fwd_imp(
188188
// mentioned above was a pretty big pessimization in some other
189189
// cases. Namely, it resulted in too much ping-ponging into and out
190190
// of the loop, which resulted in nearly ~2x regressions in search
191-
// time when compared to the originaly lazy DFA in the regex crate.
191+
// time when compared to the originally lazy DFA in the regex crate.
192192
// So I've removed the second loop unrolling that targets the
193193
// self-transition case.
194194
let mut prev_sid = sid;

0 commit comments

Comments
 (0)