Lines Matching full:vec
33 use crate::vec::Vec;
79 // HACK(japaric) needed for the implementation of `vec!` macro during testing
84 // HACK(japaric) needed for the implementation of `Vec::clone` during testing
97 use crate::vec::Vec;
100 // `vec!` macro mostly and causes perf regression. See #71204 for
102 pub fn into_vec<T, A: Allocator>(b: Box<[T], A>) -> Vec<T, A> { in into_vec()
106 Vec::from_raw_parts_in(b as *mut T, len, len, alloc) in into_vec()
112 pub fn to_vec<T: ConvertVec, A: Allocator>(s: &[T], alloc: A) -> Vec<T, A> { in to_vec()
118 fn to_vec<A: Allocator>(s: &[Self], alloc: A) -> Vec<Self, A> in to_vec()
126 default fn to_vec<A: Allocator>(s: &[Self], alloc: A) -> Vec<Self, A> { in to_vec()
128 vec: &'a mut Vec<T, A>, in to_vec() field
137 self.vec.set_len(self.num_init); in to_vec()
141 let mut vec = Vec::with_capacity_in(s.len(), alloc); in to_vec() localVariable
142 let mut guard = DropGuard { vec: &mut vec, num_init: 0 }; in to_vec()
143 let slots = guard.vec.spare_capacity_mut(); in to_vec()
152 // the vec was allocated and initialized above to at least this length. in to_vec()
154 vec.set_len(s.len()); in to_vec()
156 vec in to_vec()
163 fn to_vec<A: Allocator>(s: &[Self], alloc: A) -> Vec<Self, A> { in to_vec()
164 let mut v = Vec::with_capacity_in(s.len(), alloc); in to_vec()
337 /// In the worst case, the algorithm allocates temporary storage in a `Vec<(K, usize)>` the
362 let mut indices: Vec<_> = in sort_by_cached_key()
400 /// Copies `self` into a new `Vec`.
414 pub fn to_vec(&self) -> Vec<T> in to_vec()
421 /// Copies `self` into a new `Vec` with an allocator.
438 pub fn to_vec_in<A: Allocator>(&self, alloc: A) -> Vec<T, A> in to_vec_in()
449 /// `Vec<T>`'s `into_boxed_slice` method.
458 /// assert_eq!(x, vec![10, 40, 30]);
463 pub fn into_vec<A: Allocator>(self: Box<Self, A>) -> Vec<T, A> { in into_vec()
479 /// assert_eq!([1, 2].repeat(3), vec![1, 2, 1, 2, 1, 2]);
491 pub fn repeat(&self, n: usize) -> Vec<T> in repeat()
496 return Vec::new(); in repeat()
504 // Using `Vec` to access `set_len()`. in repeat()
506 let mut buf = Vec::with_capacity(capacity); in repeat()
619 #[must_use = "this returns the uppercase bytes as a new Vec, \
623 pub fn to_ascii_uppercase(&self) -> Vec<u8> { in to_ascii_uppercase()
640 #[must_use = "this returns the lowercase bytes as a new Vec, \
644 pub fn to_ascii_lowercase(&self) -> Vec<u8> { in to_ascii_lowercase()
674 /// pub struct Foo(Vec<u32>, Vec<String>);
710 type Output = Vec<T>;
712 fn concat(slice: &Self) -> Vec<T> { in concat()
714 let mut result = Vec::with_capacity(size); in concat()
725 type Output = Vec<T>;
727 fn join(slice: &Self, sep: &T) -> Vec<T> { in join()
731 None => return vec![], in join()
734 let mut result = Vec::with_capacity(size); in join()
748 type Output = Vec<T>;
750 fn join(slice: &Self, sep: &[T]) -> Vec<T> { in join()
754 None => return vec![], in join()
758 let mut result = Vec::with_capacity(size); in join()
774 impl<T, A: Allocator> Borrow<[T]> for Vec<T, A> { implementation
781 impl<T, A: Allocator> BorrowMut<[T]> for Vec<T, A> { implementation
789 // vec::clone_from use it too.
792 fn clone_into(&self, target: &mut Vec<T, A>); in clone_into()
797 default fn clone_into(&self, target: &mut Vec<T, A>) { in clone_into()
813 fn clone_into(&self, target: &mut Vec<T, A>) { in clone_into()
822 type Owned = Vec<T>;
824 fn to_owned(&self) -> Vec<T> { in to_owned()
829 fn to_owned(&self) -> Vec<T> { in to_owned()
833 fn clone_into(&self, target: &mut Vec<T>) { in clone_into()