From eb1de23ff54400998aefd0529088e5cab2f8d677 Mon Sep 17 00:00:00 2001 From: Vinzent Steinberg Date: Tue, 24 Aug 2021 18:09:00 +0200 Subject: [PATCH 1/3] Fix spelling --- rand_chacha/src/chacha.rs | 2 +- rand_core/src/error.rs | 2 +- rand_core/src/lib.rs | 2 +- rand_distr/src/binomial.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rand_chacha/src/chacha.rs b/rand_chacha/src/chacha.rs index 50da81bfafe..c7150127b3c 100644 --- a/rand_chacha/src/chacha.rs +++ b/rand_chacha/src/chacha.rs @@ -182,7 +182,7 @@ macro_rules! chacha_impl { impl $ChaChaXRng { // The buffer is a 4-block window, i.e. it is always at a block-aligned position in the - // stream but if the stream has been seeked it may not be self-aligned. + // stream but if the stream has been sought it may not be self-aligned. /// Get the offset from the start of the stream, in 32-bit words. /// diff --git a/rand_core/src/error.rs b/rand_core/src/error.rs index a64c430da8b..411896f2c47 100644 --- a/rand_core/src/error.rs +++ b/rand_core/src/error.rs @@ -82,7 +82,7 @@ impl Error { /// /// This method is identical to `std::io::Error::raw_os_error()`, except /// that it works in `no_std` contexts. If this method returns `None`, the - /// error value can still be formatted via the `Diplay` implementation. + /// error value can still be formatted via the `Display` implementation. #[inline] pub fn raw_os_error(&self) -> Option { #[cfg(feature = "std")] diff --git a/rand_core/src/lib.rs b/rand_core/src/lib.rs index bc24270771b..d03288c4e50 100644 --- a/rand_core/src/lib.rs +++ b/rand_core/src/lib.rs @@ -196,7 +196,7 @@ pub trait RngCore { /// Some generators may satisfy an additional property, however this is not /// required by this trait: if the CSPRNG's state is revealed, it should not be /// computationally-feasible to reconstruct output prior to this. Some other -/// generators allow backwards-computation and are consided *reversible*. +/// generators allow backwards-computation and are considered *reversible*. /// /// Note that this trait is provided for guidance only and cannot guarantee /// suitability for cryptographic applications. In general it should only be diff --git a/rand_distr/src/binomial.rs b/rand_distr/src/binomial.rs index 5efe367e126..14ae5aa6c79 100644 --- a/rand_distr/src/binomial.rs +++ b/rand_distr/src/binomial.rs @@ -73,7 +73,7 @@ impl Binomial { } } -/// Convert a `f64` to an `i64`, panicing on overflow. +/// Convert a `f64` to an `i64`, panicking on overflow. // In the future (Rust 1.34), this might be replaced with `TryFrom`. fn f64_to_i64(x: f64) -> i64 { assert!(x < (core::i64::MAX as f64)); From 8bdee0d46458dd28af4ddae78d46f5cf08ada380 Mon Sep 17 00:00:00 2001 From: Vinzent Steinberg Date: Tue, 24 Aug 2021 18:14:12 +0200 Subject: [PATCH 2/3] Remove outdated comment `TryFrom` does not support floats. --- rand_distr/src/binomial.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/rand_distr/src/binomial.rs b/rand_distr/src/binomial.rs index 14ae5aa6c79..8e7513a2477 100644 --- a/rand_distr/src/binomial.rs +++ b/rand_distr/src/binomial.rs @@ -74,7 +74,6 @@ impl Binomial { } /// Convert a `f64` to an `i64`, panicking on overflow. -// In the future (Rust 1.34), this might be replaced with `TryFrom`. fn f64_to_i64(x: f64) -> i64 { assert!(x < (core::i64::MAX as f64)); x as i64 From 36c16383f8cca13b7581f611417cff99a78c9052 Mon Sep 17 00:00:00 2001 From: Vinzent Steinberg Date: Tue, 24 Aug 2021 20:44:31 +0200 Subject: [PATCH 3/3] Fix more spelling mistakes --- rand_core/src/lib.rs | 2 +- rand_distr/src/geometric.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rand_core/src/lib.rs b/rand_core/src/lib.rs index d03288c4e50..1ae692cc701 100644 --- a/rand_core/src/lib.rs +++ b/rand_core/src/lib.rs @@ -215,7 +215,7 @@ pub trait CryptoRng {} /// /// [`rand`]: https://docs.rs/rand pub trait SeedableRng: Sized { - /// Seed type, which is restricted to types mutably-dereferencable as `u8` + /// Seed type, which is restricted to types mutably-dereferenceable as `u8` /// arrays (we recommend `[u8; N]` for some `N`). /// /// It is recommended to seed PRNGs with a seed of at least circa 100 bits, diff --git a/rand_distr/src/geometric.rs b/rand_distr/src/geometric.rs index 31bf98c896e..7988261a380 100644 --- a/rand_distr/src/geometric.rs +++ b/rand_distr/src/geometric.rs @@ -55,7 +55,7 @@ impl std::error::Error for Error {} impl Geometric { /// Construct a new `Geometric` with the given shape parameter `p` - /// (probablity of success on each trial). + /// (probability of success on each trial). pub fn new(p: f64) -> Result { if !p.is_finite() || p < 0.0 || p > 1.0 { Err(Error::InvalidProbability)