Skip to content

Commit

Permalink
fixup! Fix minor documentation typos
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrutar committed Nov 8, 2024
1 parent f3fd331 commit c6b5146
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
7 changes: 4 additions & 3 deletions matcher/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,13 @@ impl Matcher {
self.fuzzy_matcher_impl::<false>(haystack, needle, &mut Vec::new())
}

/// Find the fuzzy match with the higehest score in the `haystack` and
/// Find the fuzzy match with the highest score in the `haystack` and
/// compute its indices.
///
/// This functions has `O(mn)` time complexity for short inputs. To
/// avoid slowdowns it automatically falls back to [greedy matching]
/// (crate::Matcher::fuzzy_match_greedy) for large needles and haystacks
/// avoid slowdowns it automatically falls back to
/// [greedy matching](crate::Matcher::fuzzy_match_greedy) for large needles
/// and haystacks
///
/// See the [matcher documentation](crate::Matcher) for more details.
pub fn fuzzy_indices(
Expand Down
12 changes: 6 additions & 6 deletions matcher/src/pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,8 @@ pub struct Pattern {

impl Pattern {
/// Creates a pattern where each word is matched individually (whitespaces
/// can be escaped with `\`). Otherwise no parsing is performed (so $, !, '
/// and ^ don't receive special treatment). If you want to match the entire
/// can be escaped with `\`). Otherwise no parsing is performed (so `$`, `!`,
/// `'` and `^` don't receive special treatment). If you want to match the entire
/// pattern as a single needle use a single [`Atom`] instead.
pub fn new(
pattern: &str,
Expand All @@ -437,7 +437,7 @@ impl Pattern {
Pattern { atoms }
}
/// Creates a pattern where each word is matched individually (whitespaces
/// can be escaped with `\`). And $, !, ' and ^ at word boundaries will
/// can be escaped with `\`). And `$`, `!`, `'` and `^` at word boundaries will
/// cause different matching behaviour (see [`AtomKind`]). These can be
/// escaped with backslash.
pub fn parse(pattern: &str, case_matching: CaseMatching, normalize: Normalization) -> Pattern {
Expand Down Expand Up @@ -479,8 +479,8 @@ impl Pattern {
}

/// Matches this pattern against `haystack` (using the allocation and configuration
/// from `matcher`) and calculates a ranking score. See the [`Matcher`].
/// Documentation for more details.
/// from `matcher`) and calculates a ranking score. See the [`Matcher`]
/// documentation for more details.
///
/// *Note:* The `ignore_case` setting is overwritten to match the casing of
/// each pattern atom.
Expand All @@ -497,7 +497,7 @@ impl Pattern {

/// Matches this pattern against `haystack` (using the allocation and
/// configuration from `matcher`), calculates a ranking score and the match
/// indices. See the [`Matcher`]. Documentation for more
/// indices. See the [`Matcher`] documentation for more
/// details.
///
/// *Note:* The `ignore_case` setting is overwritten to match the casing of
Expand Down

0 comments on commit c6b5146

Please sign in to comment.