Make os_str_bytes::{Buf, Slice} pub and repr(transparent)
This commit is contained in:
@@ -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],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user