Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rust: num: fix typos in Bounded documentation

Fix several typos and grammatical errors in the Bounded type documentation:
- "less significant bits" -> "least significant bits"
- "with in" -> "within"
- "withheld" -> "upheld"
- "// This" -> "// This" (double space)
- "doesn't fits" -> "doesn't fit" (2 occurrences)

Reported-by: Miguel Ojeda <ojeda@kernel.org>
Closes: https://github.com/Rust-for-Linux/linux/issues/1210
Signed-off-by: Nakamura Shuta <nakamura.shuta@gmail.com>
Acked-by: Alexandre Courbot <acourbot@nvidia.com>
Acked-by: Yury Norov (NVIDIA) <yury.norov@nvidia.com>
Fixes: 01e345e82ec3 ("rust: num: add Bounded integer wrapping type")
Link: https://patch.msgid.link/20251204024336.246587-1-nakamura.shuta@gmail.com
[ Removed Link tag due to duplicated URL. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

authored by

Nakamura Shuta and committed by
Miguel Ojeda
f6b8d4b7 1e4e2a84

+6 -6
+6 -6
rust/kernel/num/bounded.rs
··· 40 40 fits_within!(value, T, num_bits) 41 41 } 42 42 43 - /// An integer value that requires only the `N` less significant bits of the wrapped type to be 43 + /// An integer value that requires only the `N` least significant bits of the wrapped type to be 44 44 /// encoded. 45 45 /// 46 46 /// This limits the number of usable bits in the wrapped integer type, and thus the stored value to 47 - /// a narrower range, which provides guarantees that can be useful when working with in e.g. 47 + /// a narrower range, which provides guarantees that can be useful when working within e.g. 48 48 /// bitfields. 49 49 /// 50 50 /// # Invariants ··· 56 56 /// # Examples 57 57 /// 58 58 /// The preferred way to create values is through constants and the [`Bounded::new`] family of 59 - /// constructors, as they trigger a build error if the type invariants cannot be withheld. 59 + /// constructors, as they trigger a build error if the type invariants cannot be upheld. 60 60 /// 61 61 /// ``` 62 62 /// use kernel::num::Bounded; ··· 82 82 /// ``` 83 83 /// use kernel::num::Bounded; 84 84 /// 85 - /// // This succeeds because `15` can be represented with 4 unsigned bits. 85 + /// // This succeeds because `15` can be represented with 4 unsigned bits. 86 86 /// assert!(Bounded::<u8, 4>::try_new(15).is_some()); 87 87 /// 88 88 /// // This fails because `16` cannot be represented with 4 unsigned bits. ··· 221 221 /// let v: Option<Bounded<u16, 8>> = 128u32.try_into_bounded(); 222 222 /// assert_eq!(v.as_deref().copied(), Some(128)); 223 223 /// 224 - /// // Fails because `128` doesn't fits into 6 bits. 224 + /// // Fails because `128` doesn't fit into 6 bits. 225 225 /// let v: Option<Bounded<u16, 6>> = 128u32.try_into_bounded(); 226 226 /// assert_eq!(v, None); 227 227 /// ``` ··· 501 501 /// let v: Option<Bounded<u16, 8>> = 128u32.try_into_bounded(); 502 502 /// assert_eq!(v.as_deref().copied(), Some(128)); 503 503 /// 504 - /// // Fails because `128` doesn't fits into 6 bits. 504 + /// // Fails because `128` doesn't fit into 6 bits. 505 505 /// let v: Option<Bounded<u16, 6>> = 128u32.try_into_bounded(); 506 506 /// assert_eq!(v, None); 507 507 /// ```