Skip to content

Commit

Permalink
Remove an #[inline] that I'd added
Browse files Browse the repository at this point in the history
  • Loading branch information
scottmcm committed Nov 19, 2022
1 parent 50b394a commit 78f2356
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions library/alloc/src/vec/spec_from_elem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@ pub(super) trait SpecFromElem: Sized {
fn from_elem<A: Allocator>(elem: Self, n: usize, alloc: A) -> Vec<Self, A>;
}

#[inline]
fn basic_from_elem<T: Clone, A: Allocator>(elem: T, n: usize, alloc: A) -> Vec<T, A> {
let mut v = Vec::with_capacity_in(n, alloc);
v.extend(iter::repeat_n(elem, n));
v
}

impl<T: Clone> SpecFromElem for T {
#[inline]
default fn from_elem<A: Allocator>(elem: Self, n: usize, alloc: A) -> Vec<Self, A> {
basic_from_elem(elem, n, alloc)
}
Expand Down

0 comments on commit 78f2356

Please sign in to comment.