Skip to content

Commit

Permalink
Mark Array::size() as inline
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic authored and mbrubeck committed Oct 2, 2022
1 parent e01054b commit b960b3a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib.rs
Expand Up @@ -2089,6 +2089,7 @@ impl<T, const N: usize> SmallVec<[T; N]> {
#[cfg_attr(docsrs, doc(cfg(feature = "const_generics")))]
unsafe impl<T, const N: usize> Array for [T; N] {
type Item = T;
#[inline]
fn size() -> usize {
N
}
Expand All @@ -2100,6 +2101,7 @@ macro_rules! impl_array(
$(
unsafe impl<T> Array for [T; $size] {
type Item = T;
#[inline]
fn size() -> usize { $size }
}
)+
Expand Down

0 comments on commit b960b3a

Please sign in to comment.