We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
os_str_bytes::{Buf, Slice}
pub
repr(transparent)
1 parent 1a96d22 commit 835561aCopy full SHA for 835561a
library/std/src/sys_common/os_str_bytes.rs
@@ -14,17 +14,13 @@ use crate::sys_common::{AsInner, IntoInner};
14
use core::str::lossy::Utf8Lossy;
15
16
#[derive(Hash)]
17
-pub(crate) struct Buf {
+#[repr(transparent)]
18
+pub struct Buf {
19
pub inner: Vec<u8>,
20
}
21
-// FIXME:
22
-// `Buf::as_slice` current implementation relies
23
-// on `Slice` being layout-compatible with `[u8]`.
24
-// When attribute privacy is implemented, `Slice` should be annotated as `#[repr(transparent)]`.
25
-// Anyway, `Slice` representation and layout are considered implementation detail, are
26
-// not documented and must not be relied upon.
27
-pub(crate) struct Slice {
+pub struct Slice {
28
pub inner: [u8],
29
30
0 commit comments