Skip to content

Commit 81bd43e

Browse files
authored
Fix typos and bad doc links. (#117)
1 parent 9a385f1 commit 81bd43e

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl Error {
4040
///
4141
/// This method is identical to `std::io::Error::raw_os_error()`, except
4242
/// that it works in `no_std` contexts. If this method returns `None`, the
43-
/// error value can still be formatted via the `Diplay` implementation.
43+
/// error value can still be formatted via the `Display` implementation.
4444
#[inline]
4545
pub fn raw_os_error(self) -> Option<i32> {
4646
if self.0.get() < Self::INTERNAL_START {

src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
//! | L4RE, SGX, UEFI | [RDRAND][18]
2929
//! | Hermit | [RDRAND][18] as [`sys_rand`][22] is currently broken.
3030
//! | VxWorks | `randABytes` after checking entropy pool initialization with `randSecure`
31-
//! | Web browsers | [`Crypto.getRandomValues`][14] (see [Support for WebAssembly and ams.js][14])
32-
//! | Node.js | [`crypto.randomBytes`][15] (see [Support for WebAssembly and ams.js][16])
31+
//! | Web browsers | [`Crypto.getRandomValues`][14] (see [Support for WebAssembly and asm.js][16])
32+
//! | Node.js | [`crypto.randomBytes`][15] (see [Support for WebAssembly and asm.js][16])
3333
//! | WASI | [`__wasi_random_get`][17]
3434
//!
3535
//! Getrandom doesn't have a blanket implementation for all Unix-like operating
@@ -83,7 +83,7 @@
8383
//! A few, Linux, NetBSD and Solaris, offer a choice between blocking and
8484
//! getting an error; in these cases we always choose to block.
8585
//!
86-
//! On Linux (when the `genrandom` system call is not available) and on NetBSD
86+
//! On Linux (when the `getrandom` system call is not available) and on NetBSD
8787
//! reading from `/dev/urandom` never blocks, even when the OS hasn't collected
8888
//! enough entropy yet. To avoid returning low-entropy bytes, we first read from
8989
//! `/dev/random` and only switch to `/dev/urandom` once this has succeeded.
@@ -114,7 +114,7 @@
114114
//! [13]: https://github.com/nuxinl/cloudabi#random_get
115115
//! [14]: https://www.w3.org/TR/WebCryptoAPI/#Crypto-method-getRandomValues
116116
//! [15]: https://nodejs.org/api/crypto.html#crypto_crypto_randombytes_size_callback
117-
//! [16]: #support-for-webassembly-and-amsjs
117+
//! [16]: #support-for-webassembly-and-asmjs
118118
//! [17]: https://github.com/WebAssembly/WASI/blob/master/design/WASI-core.md#__wasi_random_get
119119
//! [18]: https://software.intel.com/en-us/articles/intel-digital-random-number-generator-drng-software-implementation-guide
120120
//! [19]: https://www.unix.com/man-page/mojave/2/getentropy/
@@ -173,7 +173,7 @@ cfg_if! {
173173
target_os = "openbsd", target_os = "redox", target_os = "solaris"))] {
174174
#[allow(dead_code)]
175175
mod util_libc;
176-
// Keep std-only trait definitions for backwards compatiblity
176+
// Keep std-only trait definitions for backwards compatibility
177177
mod error_impls;
178178
} else if #[cfg(feature = "std")] {
179179
mod error_impls;

src/rdrand.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ unsafe fn rdrand() -> Result<[u8; WORD_SIZE], Error> {
2626
let mut el = mem::zeroed();
2727
if _rdrand64_step(&mut el) == 1 {
2828
// AMD CPUs from families 14h to 16h (pre Ryzen) sometimes fail to
29-
// set CF on bogus random data, so we check these values explictly.
29+
// set CF on bogus random data, so we check these values explicitly.
3030
// See https://github.com/systemd/systemd/issues/11810#issuecomment-489727505
3131
// We perform this check regardless of target to guard against
3232
// any implementation that incorrectly fails to set CF.

src/solaris_illumos.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
//!
1616
//! Since Solaris 11.3 and mid-2015 illumos, the `getrandom` syscall is available.
1717
//! To make sure we can compile on both Solaris and its derivatives, as well as
18-
//! function, we check for the existance of getrandom(2) in libc by calling
18+
//! function, we check for the existence of getrandom(2) in libc by calling
1919
//! libc::dlsym.
2020
use crate::util_libc::{sys_fill_exact, Weak};
2121
use crate::{use_file, Error};

src/util.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
use core::sync::atomic::{AtomicUsize, Ordering::Relaxed};
1010

11-
// This structure represents a laziliy initialized static usize value. Useful
12-
// when it is perferable to just rerun initialization instead of locking.
11+
// This structure represents a lazily initialized static usize value. Useful
12+
// when it is preferable to just rerun initialization instead of locking.
1313
// Both unsync_init and sync_init will invoke an init() function until it
1414
// succeeds, then return the cached value for future calls.
1515
//
@@ -25,7 +25,7 @@ use core::sync::atomic::{AtomicUsize, Ordering::Relaxed};
2525
// v
2626
// }
2727
// the effects of c() or writes to shared memory will not necessarily be
28-
// observed and additional syncronization methods with be needed.
28+
// observed and additional synchronization methods with be needed.
2929
pub struct LazyUsize(AtomicUsize);
3030

3131
impl LazyUsize {

src/windows_uwp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// except according to those terms.
88

99
//! Implementation for Windows UWP targets. After deprecation of Windows XP
10-
//! and Vista, this can superseed the `RtlGenRandom`-based implementation.
10+
//! and Vista, this can supersede the `RtlGenRandom`-based implementation.
1111
use crate::Error;
1212
use core::{ffi::c_void, num::NonZeroU32, ptr};
1313

0 commit comments

Comments
 (0)