Skip to content

Commit

Permalink
tweak docs
Browse files Browse the repository at this point in the history
  • Loading branch information
noib3 committed Dec 2, 2023
1 parent 564d81c commit 129b178
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
//! # Examples
//!
//! ```rust
//! # use core::ops::Range;
//! use norm::fzf::{FzfParser, FzfV2};
//! use norm::Metric;
//!
Expand All @@ -39,8 +40,8 @@
//! .filter_map(|city| fzf.distance(query, city).map(|dist| (city, dist)))
//! .collect::<Vec<_>>();
//!
//! // We sort the results by distance in ascending order, so that the best match
//! // will be at the front of the vector.
//! // We sort the results by distance in ascending order, so that the best
//! // match will be at the front of the vector.
//! results.sort_by_key(|(_city, dist)| *dist);
//!
//! assert_eq!(results.len(), 2);
Expand All @@ -50,7 +51,7 @@
//! // We can also find out which sub-strings of each candidate matched the
//! // query.
//!
//! let mut ranges = Vec::new();
//! let mut ranges: Vec<Range<usize>> = Vec::new();
//!
//! let _ = fzf.distance_and_ranges(query, results[0].0, &mut ranges);
//! assert_eq!(ranges.len(), 2);
Expand Down
2 changes: 1 addition & 1 deletion src/metrics/fzf/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Metrics implementing fzf's fuzzy search algorithm.
//! Metrics implementing fzf's algorithms.
//!
//! This module contains two metrics -- [`FzfV1`] and [`FzfV2`] -- which were
//! ported from [fzf], a popular command-line fuzzy-finder.
Expand Down
2 changes: 1 addition & 1 deletion src/metrics/fzf/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use core::fmt::Write;

/// A parsed fzf query.
///
/// This struct is created by the [`parse`](super::FzfParser::parse) method on
/// This struct is created by parsing a query string via the
/// [`FzfParser`](super::FzfParser). See its documentation for more.
#[derive(Clone, Copy)]
pub struct FzfQuery<'a> {
Expand Down

0 comments on commit 129b178

Please sign in to comment.