Skip to content

Commit 977aabd

Browse files
authored
doc: fix some typos
PR #774
1 parent 26c8d8e commit 977aabd

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

PERFORMANCE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ In general, these are ordered from fastest to slowest.
145145
`is_match` is fastest because it doesn't actually need to find the start or the
146146
end of the leftmost-first match. It can quit immediately after it knows there
147147
is a match. For example, given the regex `a+` and the haystack, `aaaaa`, the
148-
search will quit after examing the first byte.
148+
search will quit after examining the first byte.
149149

150-
In constrast, `find` must return both the start and end location of the
150+
In contrast, `find` must return both the start and end location of the
151151
leftmost-first match. It can use the DFA matcher for this, but must run it
152152
forwards once to find the end of the match *and then run it backwards* to find
153153
the start of the match. The two scans and the cost of finding the real end of
@@ -196,7 +196,7 @@ a few examples of regexes that get literal prefixes detected:
196196

197197
Literals in anchored regexes can also be used for detecting non-matches very
198198
quickly. For example, `^foo\w+` and `\w+foo$` may be able to detect a non-match
199-
just by examing the first (or last) three bytes of the haystack.
199+
just by examining the first (or last) three bytes of the haystack.
200200

201201
## Unicode word boundaries may prevent the DFA from being used
202202

regex-syntax/src/ast/parse.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ impl ParserBuilder {
167167
/// they should impose a limit on the length, in bytes, of the concrete
168168
/// pattern string. In particular, this is viable since this parser
169169
/// implementation will limit itself to heap space proportional to the
170-
/// lenth of the pattern string.
170+
/// length of the pattern string.
171171
///
172172
/// Note that a nest limit of `0` will return a nest limit error for most
173173
/// patterns but not all. For example, a nest limit of `0` permits `a` but
@@ -236,7 +236,7 @@ pub struct Parser {
236236
/// supported.
237237
octal: bool,
238238
/// The initial setting for `ignore_whitespace` as provided by
239-
/// Th`ParserBuilder`. is is used when reseting the parser's state.
239+
/// `ParserBuilder`. It is used when resetting the parser's state.
240240
initial_ignore_whitespace: bool,
241241
/// Whether whitespace should be ignored. When enabled, comments are
242242
/// also permitted.
@@ -1023,7 +1023,7 @@ impl<'s, P: Borrow<Parser>> ParserI<'s, P> {
10231023
/// The given `kind` should correspond to the operator observed by the
10241024
/// caller.
10251025
///
1026-
/// This assumes that the paser is currently positioned at the repetition
1026+
/// This assumes that the parser is currently positioned at the repetition
10271027
/// operator and advances the parser to the first character after the
10281028
/// operator. (Note that the operator may include a single additional `?`,
10291029
/// which makes the operator ungreedy.)
@@ -1078,7 +1078,7 @@ impl<'s, P: Borrow<Parser>> ParserI<'s, P> {
10781078
/// corresponds to the {m,n} syntax, and does not include the ?, * or +
10791079
/// operators.
10801080
///
1081-
/// This assumes that the paser is currently positioned at the opening `{`
1081+
/// This assumes that the parser is currently positioned at the opening `{`
10821082
/// and advances the parser to the first character after the operator.
10831083
/// (Note that the operator may include a single additional `?`, which
10841084
/// makes the operator ungreedy.)

regex-syntax/src/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl ParserBuilder {
4545
/// they should impose a limit on the length, in bytes, of the concrete
4646
/// pattern string. In particular, this is viable since this parser
4747
/// implementation will limit itself to heap space proportional to the
48-
/// lenth of the pattern string.
48+
/// length of the pattern string.
4949
///
5050
/// Note that a nest limit of `0` will return a nest limit error for most
5151
/// patterns but not all. For example, a nest limit of `0` permits `a` but

src/exec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ impl ExecBuilder {
140140
///
141141
/// Note that when compiling 2 or more regular expressions, capture groups
142142
/// are completely unsupported. (This means both `find` and `captures`
143-
/// wont work.)
143+
/// won't work.)
144144
pub fn new_many<I, S>(res: I) -> Self
145145
where
146146
S: AsRef<str>,

0 commit comments

Comments
 (0)