Skip to content

Commit

Permalink
Add more inline(always) to fix opt-level=z test on wasm32
Browse files Browse the repository at this point in the history
  • Loading branch information
saethlin committed Feb 15, 2024
1 parent a23e6c3 commit c2344cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/core/src/slice/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ unsafe impl<T> SliceIndex<[T]> for ops::Range<usize> {
}
}

#[inline]
#[inline(always)]
fn index(self, slice: &[T]) -> &[T] {
if self.start > self.end {
slice_index_order_fail(self.start, self.end);
Expand Down Expand Up @@ -440,7 +440,7 @@ unsafe impl<T> SliceIndex<[T]> for ops::RangeTo<usize> {
unsafe { (0..self.end).get_unchecked_mut(slice) }
}

#[inline]
#[inline(always)]
fn index(self, slice: &[T]) -> &[T] {
(0..self.end).index(slice)
}
Expand Down

0 comments on commit c2344cb

Please sign in to comment.