Skip to content

Commit

Permalink
Mark OwnedSlice::{deref, borrow} as #[inline]
Browse files Browse the repository at this point in the history
  • Loading branch information
WaffleLapkin committed Apr 7, 2023
1 parent 2733c29 commit fbe0591
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions compiler/rustc_data_structures/src/owned_slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ where
impl Deref for OwnedSlice {
type Target = [u8];

#[inline]
fn deref(&self) -> &[u8] {
// Safety:
// `self.bytes` is valid per the construction in `slice_owned`
Expand All @@ -101,6 +102,7 @@ impl Deref for OwnedSlice {
}

impl Borrow<[u8]> for OwnedSlice {
#[inline]
fn borrow(&self) -> &[u8] {
self
}
Expand Down

0 comments on commit fbe0591

Please sign in to comment.