mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 02:03:53 +00:00
Mark OwnedSlice::{deref, borrow}
as #[inline]
This commit is contained in:
parent
2733c29bb1
commit
fbe0591c68
@ -92,6 +92,7 @@ where
|
|||||||
impl Deref for OwnedSlice {
|
impl Deref for OwnedSlice {
|
||||||
type Target = [u8];
|
type Target = [u8];
|
||||||
|
|
||||||
|
#[inline]
|
||||||
fn deref(&self) -> &[u8] {
|
fn deref(&self) -> &[u8] {
|
||||||
// Safety:
|
// Safety:
|
||||||
// `self.bytes` is valid per the construction in `slice_owned`
|
// `self.bytes` is valid per the construction in `slice_owned`
|
||||||
@ -101,6 +102,7 @@ impl Deref for OwnedSlice {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Borrow<[u8]> for OwnedSlice {
|
impl Borrow<[u8]> for OwnedSlice {
|
||||||
|
#[inline]
|
||||||
fn borrow(&self) -> &[u8] {
|
fn borrow(&self) -> &[u8] {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user