Skip to content

Commit

Permalink
Moar #[inline]
Browse files Browse the repository at this point in the history
  • Loading branch information
scottmcm committed Nov 10, 2021
1 parent cc7d801 commit 5b115fc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions library/core/src/array/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ trait SpecArrayClone: Clone {

#[cfg(not(bootstrap))]
impl<T: Clone> SpecArrayClone for T {
#[inline]
default fn clone<const N: usize>(array: &[T; N]) -> [T; N] {
// SAFETY: we know for certain that this iterator will yield exactly `N`
// items.
Expand All @@ -364,6 +365,7 @@ impl<T: Clone> SpecArrayClone for T {

#[cfg(not(bootstrap))]
impl<T: Copy> SpecArrayClone for T {
#[inline]
fn clone<const N: usize>(array: &[T; N]) -> [T; N] {
*array
}
Expand Down

0 comments on commit 5b115fc

Please sign in to comment.