Skip to content

Commit f5f6d89

Browse files
committed
Add #[inline] attribute to all fns which return SmallVec
1 parent 9cdf8fb commit f5f6d89

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,6 +1055,7 @@ impl<A: Array> SmallVec<A> {
10551055
/// assert_eq!(&*rebuilt, &[4, 5, 6]);
10561056
/// }
10571057
/// }
1058+
#[inline]
10581059
pub unsafe fn from_raw_parts(ptr: *mut A::Item, length: usize, capacity: usize) -> SmallVec<A> {
10591060
assert!(capacity > A::size());
10601061
SmallVec {
@@ -1372,6 +1373,7 @@ where
13721373
}
13731374

13741375
impl<A: Array> FromIterator<A::Item> for SmallVec<A> {
1376+
#[inline]
13751377
fn from_iter<I: IntoIterator<Item = A::Item>>(iterable: I) -> SmallVec<A> {
13761378
let mut v = SmallVec::new();
13771379
v.extend(iterable);
@@ -1452,6 +1454,7 @@ impl<A: Array> Clone for SmallVec<A>
14521454
where
14531455
A::Item: Clone,
14541456
{
1457+
#[inline]
14551458
fn clone(&self) -> SmallVec<A> {
14561459
let mut new_vector = SmallVec::with_capacity(self.len());
14571460
for element in self.iter() {
@@ -1700,6 +1703,7 @@ trait ToSmallVec<A:Array> {
17001703

17011704
impl<A:Array> ToSmallVec<A> for [A::Item]
17021705
where A::Item: Copy {
1706+
#[inline]
17031707
fn to_smallvec(&self) -> SmallVec<A> {
17041708
SmallVec::from_slice(self)
17051709
}

0 commit comments

Comments
 (0)