Lines Matching defs:take
459 let s = repeat(0xf5).take(100).collect::<Vec<_>>();
605 b.iter(|| repeat(5).take(src_len).collect::<Vec<usize>>())
753 let tmp = std::mem::take(&mut data);
1005 let tmp = std::mem::take(&mut data);
1025 let tmp = std::mem::take(&mut data);
1061 let v = std::mem::take(&mut vec);
1079 let v: Vec<Droppable> = std::iter::repeat_with(|| Droppable(0)).take(1000).collect();
2219 (&mut rng).sample_iter(&Standard).take(len).collect()
2224 (&mut rng).sample_iter(&Standard).take(len).collect()
2254 v.push((&mut rng).sample_iter(&Alphanumeric).take(n).collect());
2261 (&mut rng).sample_iter(&Standard).map(|x| [x; 16]).take(len).collect()
2480 let mut heap: BinaryHeap<_> = iter.by_ref().take(1000).collect();
7549 let sink: Vec<_> = iter.skip(1).take(1).collect();
7617 let _ = v.into_iter().take(0).collect::<Vec<_>>();
8207 // Laundering the lifetime -- we take care that `v` does not reallocate, so that's okay.
9645 rng.sample_iter::<i32, _>(&Standard).map(|x| x % modulus).take(len).collect();
10539 for slice in xs.split_mut(|x| *x == 0).take(5) {
10548 for slice in xs.split_mut(|x| *x == 0).rev().take(4) {
10955 for (i, c) in DROP_COUNTS.iter().enumerate().take(len) {
11708 let seq = (0..).step_by(2).take(256);
12715 let v: VecDeque<()> = std::iter::repeat(()).take(42).collect();
13560 assert_eq!(q.drain().take(5).count(), 5);
13569 assert_eq!(q.drain_sorted().take(5).collect::<Vec<_>>(), vec![9, 8, 7, 6, 5]);
14481 /// If you change `RawVec<T>::new` or dependencies, please take care to not introduce anything
15186 let mut b = mem::take(target).into_bytes();
15282 for (start, part) in self.match_indices(pat).take(count) {
16608 /// This method will take care to not copy the vector, for efficiency's
20791 /// Unsafe because the caller must either take ownership or bind `T: Copy`
22163 // .take(slots.len()) is necessary for LLVM to remove bounds checks
22165 for (i, b) in s.iter().enumerate().take(slots.len()) {
24441 /// Unsafe because the caller must either take ownership or bind `T: Copy`.
25074 // fetch_add as this function should never take the reference count
25841 //! example, the format string `{} {} {}` would take three parameters, and they
25903 //! This is a parameter for the "minimum width" that the format should take up.
25905 //! padding specified by fill/alignment will be used to take up the required
27223 let head = self.head.take();
27224 let tail = self.tail.take();
27245 first_part_tail = split_node.as_mut().prev.take();
27285 second_part_head = split_node.as_mut().next.take();
27376 if let Some(mut other_head) = other.head.take() {
27382 self.tail = other.tail.take();
27397 if let Some(mut other_tail) = other.tail.take() {
27403 self.head = other.head.take();
27807 return mem::take(self);
28121 match self.current.take() {
28143 match self.current.take() {
28218 match self.current.take() {
28240 match self.current.take() {
29848 /// to take O(B * log(n)) comparisons, which is generally worse than a BST. In practice,
29943 if let Some(root) = self.root.take() {
30041 fn take(&mut self, key: &Q) -> Option<K> {
30796 let self_iter = mem::take(self).into_iter();
30797 let other_iter = mem::take(other).into_iter();
31223 if let Some(root) = me.root.take() {
31267 if let Some(front) = self.range.front.take() {
31420 /// Wrapped in `Option` to allow drop handler to `take` it.
31478 while let Ok(mut kv) = self.cur_leaf_edge.take()?.next_kv() {
31485 let root = unsafe { self.dormant_root.take().unwrap().awaken() };
33001 /// assert_eq!(set.take(&2), Some(2));
33002 /// assert_eq!(set.take(&2), None);
33005 pub fn take<Q: ?Sized>(&mut self, value: &Q) -> Option<T>
33010 Recover::take(&mut self.map, value)
33697 IntersectionInner::Answer(answer) => answer.take(),
34281 fn take(&mut self, key: &Q) -> Option<Self::Key>;
34799 assert_eq!(s.take(&Foo("a", 1)), Some(Foo("a", 2)));
34803 assert_eq!(s.take(&Foo("a", 1)), None);
35678 let iter = mem::take(self).into_iter();
36872 // Existing key (take)
37611 let small_keys = data.iter().take(len / 2).map(|kv| kv.0);
37886 match self.peeked.take() {
37902 Ordering::Less => self.peeked = b_next.take().map(Peeked::B),
37903 Ordering::Greater => self.peeked = a_next.take().map(Peeked::A),
42344 // just take all of the second half.
42488 self.extend(repeat_with(generator).take(new_len - len))
42941 /// assert!(deque.iter().take(i).all(|&x| x < 5));
43574 let expected = (0..).take(len).collect::<VecDeque<_>>();
43718 let expected = (0..).take(len).collect::<VecDeque<_>>();
43851 let expected = (0..).take(len).collect::<VecDeque<_>>();
43885 let expected_self = (0..).take(at).collect::<VecDeque<_>>();
43887 let expected_other = (at..).take(len - at).collect::<VecDeque<_>>();
45104 /// assert_eq!(heap.into_iter_sorted().take(2).collect::<Vec<_>>(), vec![5, 4]);
46646 // must take more steps to reason about the final capacity + length
48656 // the new vector can take over the original buffer and avoid the copy