From 129b1780649e1656c1cc55c8a92686ae0dbb07d6 Mon Sep 17 00:00:00 2001 From: Riccardo Mazzarini Date: Sat, 2 Dec 2023 17:09:47 +0100 Subject: [PATCH] tweak docs --- src/lib.rs | 7 ++++--- src/metrics/fzf/mod.rs | 2 +- src/metrics/fzf/query.rs | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 07e1e2a..db2401c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -22,6 +22,7 @@ //! # Examples //! //! ```rust +//! # use core::ops::Range; //! use norm::fzf::{FzfParser, FzfV2}; //! use norm::Metric; //! @@ -39,8 +40,8 @@ //! .filter_map(|city| fzf.distance(query, city).map(|dist| (city, dist))) //! .collect::>(); //! -//! // 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); @@ -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> = Vec::new(); //! //! let _ = fzf.distance_and_ranges(query, results[0].0, &mut ranges); //! assert_eq!(ranges.len(), 2); diff --git a/src/metrics/fzf/mod.rs b/src/metrics/fzf/mod.rs index f790490..c409852 100644 --- a/src/metrics/fzf/mod.rs +++ b/src/metrics/fzf/mod.rs @@ -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. diff --git a/src/metrics/fzf/query.rs b/src/metrics/fzf/query.rs index 739f935..a458f18 100644 --- a/src/metrics/fzf/query.rs +++ b/src/metrics/fzf/query.rs @@ -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> {