From 452c79bac52a1f246b71e1a4a74979dc35bbe2d8 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Wed, 3 Feb 2021 22:57:25 +0100 Subject: [PATCH] Fixed some spelling mistakes --- src/algorithms/mod.rs | 4 ++-- src/lib.rs | 6 +++--- src/text/abstraction.rs | 6 +++--- src/text/mod.rs | 2 +- src/types.rs | 2 +- src/udiff.rs | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/algorithms/mod.rs b/src/algorithms/mod.rs index 1cba2b3..ab2d7a9 100644 --- a/src/algorithms/mod.rs +++ b/src/algorithms/mod.rs @@ -12,7 +12,7 @@ //! diff hook is not used outside of the raw algorithm implementations as for //! most situations access to the values is useful of required. //! -//! The algoriths module really is the most low-level module in similar and +//! The algorithms module really is the most low-level module in similar and //! generally not the place to start. //! //! # Example @@ -30,7 +30,7 @@ //! let ops = d.into_inner().into_ops(); //! ``` //! -//! The above example is equivalen to using +//! The above example is equivalent to using //! [`capture_diff_slices`](crate::capture_diff_slices). mod capture; diff --git a/src/lib.rs b/src/lib.rs index 3c98cff..317822d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -82,10 +82,10 @@ //! by enabling the `bytes` feature it gains support for byte slices with some //! caveats. //! -//! A lot of text diff functionality assumes that what is being diffed constiutes +//! A lot of text diff functionality assumes that what is being diffed constitutes //! text, but in the real world it can often be challenging to ensure that this is -//! all valid utf-8. Because of this the crate is built so that most functinality -//! also still works with bytes for as long as they are roughtly ASCII compatible. +//! all valid utf-8. Because of this the crate is built so that most functionality +//! also still works with bytes for as long as they are roughly ASCII compatible. //! //! This means you will be successful in creating a unified diff from latin1 //! encoded bytes but if you try to do the same with EBCDIC encoded bytes you diff --git a/src/text/abstraction.rs b/src/text/abstraction.rs index ded1857..aff39ee 100644 --- a/src/text/abstraction.rs +++ b/src/text/abstraction.rs @@ -62,14 +62,14 @@ pub trait DiffableStr: Hash + PartialEq + PartialOrd + Ord + Eq + ToOwned { /// Tokenizes into words. fn tokenize_words(&self) -> Vec<&Self>; - /// Splits the input into characters. + /// Tokenizes the input into characters. fn tokenize_chars(&self) -> Vec<&Self>; - /// Splits into unicode words. + /// Tokenizes into unicode words. #[cfg(feature = "unicode")] fn tokenize_unicode_words(&self) -> Vec<&Self>; - /// Splits into unicode graphemes.. + /// Tokenizes into unicode graphemes. #[cfg(feature = "unicode")] fn tokenize_graphemes(&self) -> Vec<&Self>; diff --git a/src/text/mod.rs b/src/text/mod.rs index 6e6d5c8..4954d2d 100644 --- a/src/text/mod.rs +++ b/src/text/mod.rs @@ -364,7 +364,7 @@ pub fn get_close_matches<'a, T: DiffableStr + ?Sized>( let diff = TextDiff::from_slices(&seq1, &seq2); let ratio = diff.ratio(); if ratio >= cutoff { - // we're putting the word iself in reverse in so that matches with + // we're putting the word itself in reverse in so that matches with // the same ratio are ordered lexicographically. matches.push(((ratio * u32::MAX as f32) as u32, Reverse(possibility))); } diff --git a/src/types.rs b/src/types.rs index caecb8e..b72ce59 100644 --- a/src/types.rs +++ b/src/types.rs @@ -345,7 +345,7 @@ mod text_additions { use crate::text::DiffableStr; use std::borrow::Cow; - /// The text interface can produce changes over [`DiffableStr`] implemeting + /// The text interface can produce changes over [`DiffableStr`] implementing /// values. As those are generic interfaces for different types of strings /// utility methods to make working with standard rust strings more enjoyable. impl<'s, T: DiffableStr + ?Sized> Change<'s, T> { diff --git a/src/udiff.rs b/src/udiff.rs index d232553..bd28c3a 100644 --- a/src/udiff.rs +++ b/src/udiff.rs @@ -146,7 +146,7 @@ impl<'diff, 'old, 'new, 'bufs, T: DiffableStr + ?Sized> UnifiedDiff<'diff, 'old, /// Sets a header to the diff. /// /// `a` and `b` are the file names that are added to the top of the unified - /// file format. The names are accepted verbaitim which lets you encode + /// file format. The names are accepted verbatim which lets you encode /// a timestamp into it when separated by a tab (`\t`). For more information /// see [the unified diff format specification](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/diff.html#tag_20_34_10_07) pub fn header(&mut self, a: &str, b: &str) -> &mut Self {