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: str: add `BStr` type

Add the `BStr` type, which is a byte string without UTF-8
validity guarantee.

It is simply an alias to `[u8]`, but has a more evident
semantical meaning.

Signed-off-by: Gary Guo <gary@garyguo.net>
[Reworded, adapted for upstream and applied latest changes]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

authored by

Gary Guo and committed by
Miguel Ojeda
7c597746 feadd062

+5
+5
rust/kernel/str.rs
··· 4 4 5 5 use core::fmt; 6 6 7 + /// Byte string without UTF-8 validity guarantee. 8 + /// 9 + /// `BStr` is simply an alias to `[u8]`, but has a more evident semantical meaning. 10 + pub type BStr = [u8]; 11 + 7 12 /// Allows formatting of [`fmt::Arguments`] into a raw buffer. 8 13 /// 9 14 /// It does not fail if callers write past the end of the buffer so that they can calculate the