From f520157bf69707142fe287d2491f2c11dfe90615 Mon Sep 17 00:00:00 2001 From: cuishuang Date: Sun, 24 Apr 2022 17:32:47 +0800 Subject: [PATCH] fix some typos Signed-off-by: cuishuang --- benches/extra/zipslices.rs | 2 +- src/flatten_ok.rs | 8 ++++---- src/free.rs | 2 +- src/kmerge_impl.rs | 2 +- src/lib.rs | 8 ++++---- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/benches/extra/zipslices.rs b/benches/extra/zipslices.rs index 8bf3967f5..633be5906 100644 --- a/benches/extra/zipslices.rs +++ b/benches/extra/zipslices.rs @@ -3,7 +3,7 @@ use std::cmp; // Note: There are different ways to implement ZipSlices. // This version performed the best in benchmarks. // -// I also implemented a version with three pointes (tptr, tend, uptr), +// I also implemented a version with three pointers (tptr, tend, uptr), // that mimiced slice::Iter and only checked bounds by using tptr == tend, // but that was inferior to this solution. diff --git a/src/flatten_ok.rs b/src/flatten_ok.rs index d46bbde4e..91168406b 100644 --- a/src/flatten_ok.rs +++ b/src/flatten_ok.rs @@ -46,7 +46,7 @@ where return Some(Ok(item)); } else { // This is necessary for the iterator to implement `FusedIterator` - // with only the orginal iterator being fused. + // with only the original iterator being fused. self.inner_front = None; } } @@ -61,7 +61,7 @@ where return Some(Ok(item)); } else { // This is necessary for the iterator to implement `FusedIterator` - // with only the orginal iterator being fused. + // with only the original iterator being fused. self.inner_back = None; } } else { @@ -105,7 +105,7 @@ where return Some(Ok(item)); } else { // This is necessary for the iterator to implement `FusedIterator` - // with only the orginal iterator being fused. + // with only the original iterator being fused. self.inner_back = None; } } @@ -120,7 +120,7 @@ where return Some(Ok(item)); } else { // This is necessary for the iterator to implement `FusedIterator` - // with only the orginal iterator being fused. + // with only the original iterator being fused. self.inner_front = None; } } else { diff --git a/src/free.rs b/src/free.rs index 667403040..3886f5f1f 100644 --- a/src/free.rs +++ b/src/free.rs @@ -239,7 +239,7 @@ pub fn min(iterable: I) -> Option } -/// Combine all iterator elements into one String, seperated by `sep`. +/// Combine all iterator elements into one String, separated by `sep`. /// /// [`IntoIterator`] enabled version of [`Itertools::join`]. /// diff --git a/src/kmerge_impl.rs b/src/kmerge_impl.rs index f51ed23e6..f2280653f 100644 --- a/src/kmerge_impl.rs +++ b/src/kmerge_impl.rs @@ -80,7 +80,7 @@ fn sift_down(heap: &mut [T], index: usize, mut less_than: S) // that wouldn't be predicted if present while child + 1 < heap.len() { // pick the smaller of the two children - // use aritmethic to avoid an unpredictable branch + // use arithmetic to avoid an unpredictable branch child += less_than(&heap[child+1], &heap[child]) as usize; // sift down is done if we are already in order diff --git a/src/lib.rs b/src/lib.rs index f2ecd3ec7..ff0bf7640 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -387,7 +387,7 @@ macro_rules! izip { /// let with_macro: Chain, Take>>, slice::Iter<_>> = /// chain![once(&0), repeat(&1).take(2), &[2, 3, 5],]; /// -/// // ...is equivalant to this: +/// // ...is equivalent to this: /// let with_method: Chain, Take>>, slice::Iter<_>> = /// once(&0) /// .chain(repeat(&1).take(2)) @@ -904,7 +904,7 @@ pub trait Itertools : Iterator { /// a series of `Result::Ok` values. `Result::Err` values are unchanged. /// /// This is useful when you have some common error type for your crate and - /// need to propogate it upwards, but the `Result::Ok` case needs to be flattened. + /// need to propagate it upwards, but the `Result::Ok` case needs to be flattened. /// /// ``` /// use itertools::Itertools; @@ -913,7 +913,7 @@ pub trait Itertools : Iterator { /// let it = input.iter().cloned().flatten_ok(); /// itertools::assert_equal(it.clone(), vec![Ok(0), Ok(1), Err(false), Ok(2), Ok(3)]); /// - /// // This can also be used to propogate errors when collecting. + /// // This can also be used to propagate errors when collecting. /// let output_result: Result, bool> = it.collect(); /// assert_eq!(output_result, Err(false)); /// ``` @@ -3157,7 +3157,7 @@ pub trait Itertools : Iterator { /// be equal to `ypos`. /// /// On an iterator of length `n`, `position_minmax` does `1.5 * n` - /// comparisons, and so is faster than calling `positon_min` and + /// comparisons, and so is faster than calling `position_min` and /// `position_max` separately which does `2 * n` comparisons. /// /// For the minimum, if several elements are equally minimum, the