From 446902b5bda3cfe65f3fe1d67bb2e63e36816c04 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 +- 2 files changed, 5 insertions(+), 4 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.