Make os_str_bytes::{Buf, Slice}
pub
and repr(transparent)
This commit is contained in:
parent
1a96d2272e
commit
835561ac5b
1 changed files with 4 additions and 8 deletions
|
@ -14,17 +14,13 @@ use crate::sys_common::{AsInner, IntoInner};
|
||||||
use core::str::lossy::Utf8Lossy;
|
use core::str::lossy::Utf8Lossy;
|
||||||
|
|
||||||
#[derive(Hash)]
|
#[derive(Hash)]
|
||||||
pub(crate) struct Buf {
|
#[repr(transparent)]
|
||||||
|
pub struct Buf {
|
||||||
pub inner: Vec<u8>,
|
pub inner: Vec<u8>,
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME:
|
#[repr(transparent)]
|
||||||
// `Buf::as_slice` current implementation relies
|
pub struct Slice {
|
||||||
// on `Slice` being layout-compatible with `[u8]`.
|
|
||||||
// When attribute privacy is implemented, `Slice` should be annotated as `#[repr(transparent)]`.
|
|
||||||
// Anyway, `Slice` representation and layout are considered implementation detail, are
|
|
||||||
// not documented and must not be relied upon.
|
|
||||||
pub(crate) struct Slice {
|
|
||||||
pub inner: [u8],
|
pub inner: [u8],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue