We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
AsRef<BStr>
[u8]
BStr
1 parent 50a5ff0 commit d2e3f79Copy full SHA for d2e3f79
rust/kernel/str.rs
@@ -125,6 +125,18 @@ where
125
}
126
127
128
+impl AsRef<BStr> for [u8] {
129
+ fn as_ref(&self) -> &BStr {
130
+ BStr::from_bytes(self)
131
+ }
132
+}
133
+
134
+impl AsRef<BStr> for BStr {
135
136
+ self
137
138
139
140
/// Creates a new [`BStr`] from a string literal.
141
///
142
/// `b_str!` converts the supplied string literal to byte string, so non-ASCII
0 commit comments