Lines Matching defs:last
2686 // no-op on the last index
3458 // `(_, Some(exact_len))` but where `.next()` drops before the last iteration.
4658 assert_eq!(it.last(), Some('m'));
4728 assert_eq!(b.last().unwrap(), 109)
4770 assert_eq!(it.last(), Some((27, 'm')));
8223 v.swap_remove(1); // swap_remove the last element
9211 // `(_, Some(exact_len))` but where `.next()` drops before the last iteration.
9413 assert_eq!(a.last(), None);
9415 assert_eq!(a.last().unwrap(), &11);
9417 assert_eq!(a.last().unwrap(), &12);
12080 let last = cap - first;
12090 for j in -last..0 {
12093 let expected_left: Vec<_> = (-last..=j).rev().collect();
12108 let last = cap - first;
12118 for j in -last..0 {
12121 let expected_left: Vec<_> = (-last..=j).rev().collect();
13414 assert_eq!(heap.peek().unwrap(), sorted.last().unwrap());
17310 /// Removes the last character from the string buffer and returns it.
17663 /// Panics if `at` is not on a `UTF-8` code point boundary, or if it is beyond the last
18442 // See <https://github.com/rust-lang/rust/pull/74852>, the last attempt
18793 fn last(mut self) -> Option<char> {
19501 //! pointer to the same allocation in the heap. When the last [`Rc`] pointer to a
19633 //! // with them the last counted references to our `Owner`. Gadget Man now
21607 /// // Decrement the last weak count.
21700 // the field may be mutated concurrently (for example, if the last `Rc`
21959 // Because RcBox is repr(C), it will always be the last field in memory.
23336 /// source `Arc`, while increasing a reference count. When the last `Arc`
24639 // We removed the last strong ref, but there are additional weak
24759 // counter in `drop` -- the only access that happens when any but the last reference
25018 /// // Decrement the last weak count.
25152 // the field may be mutated concurrently (for example, if the last `Arc`
25292 // If we find out that we were the last weak pointer, then its time to
25788 // Because RcBox is repr(C), it will always be the last field in memory.
27756 /// Removes the last element from a list and returns it, or `None` if
27965 fn last(mut self) -> Option<&'a T> {
28019 fn last(mut self) -> Option<&'a mut T> {
28117 /// the first element of the `LinkedList`. If it is pointing to the last
28139 /// the last element of the `LinkedList`. If it is pointing to the first
28170 /// the first element of the `LinkedList`. If it is pointing to the last
28186 /// the last element of the `LinkedList`. If it is pointing to the first
28214 /// the first element of the `LinkedList`. If it is pointing to the last
28236 /// the last element of the `LinkedList`. If it is pointing to the first
28267 /// the first element of the `LinkedList`. If it is pointing to the last
28283 /// the last element of the `LinkedList`. If it is pointing to the first
28804 // verify that the tail node points to the last node.
30450 /// Returns the last key-value pair in the map.
30475 /// Returns the last entry in the map for in-place manipulation.
30489 /// entry.insert("last");
30493 /// assert_eq!(*map.get(&2).unwrap(), "last");
30506 /// Removes and returns the last element in the map.
31104 fn last(mut self) -> Option<(&'a K, &'a V)> {
31173 fn last(mut self) -> Option<(&'a K, &'a mut V)> {
31325 fn last(mut self) -> Option<&'a K> {
31374 fn last(mut self) -> Option<&'a V> {
31422 /// Contains a leaf edge preceding the next element to be returned, or the last leaf edge.
31423 /// Empty if the map has no root, if iteration went beyond the last leaf edge,
31518 fn last(mut self) -> Option<(&'a K, &'a V)> {
31543 fn last(mut self) -> Option<&'a mut V> {
31583 fn last(mut self) -> Option<K> {
31625 fn last(mut self) -> Option<V> {
31678 fn last(mut self) -> Option<(&'a K, &'a mut V)> {
32472 if let (Some(self_min), Some(self_max)) = (self.first(), self.last()) {
32478 if let (Some(other_min), Some(other_max)) = (other.first(), other.last()) {
32561 if let (Some(self_min), Some(self_max)) = (self.first(), self.last()) {
32567 if let (Some(other_min), Some(other_max)) = (other.first(), other.last()) {
32732 if let (Some(self_min), Some(self_max)) = (self.first(), self.last()) {
32738 if let (Some(other_min), Some(other_max)) = (other.first(), other.last()) {
32834 /// Returns a reference to the last value in the set, if any.
32846 /// assert_eq!(set.last(), None);
32848 /// assert_eq!(set.last(), Some(&1));
32850 /// assert_eq!(set.last(), Some(&2));
32853 pub fn last(&self) -> Option<&T>
32885 /// Removes the last value from the set and returns it, if any.
32886 /// The last value is always the maximum value in the set.
33462 fn last(mut self) -> Option<&'a T> {
33533 fn last(mut self) -> Option<&'a T> {
33920 /// If the leaf edge is the last one in the tree, returns [`Result::Err`] with the root node.
33966 /// If the internal edge is the last one in the tree, returns [`Result::Err`] with the root node.
34097 // Doing this last is faster, according to benchmarks.
34112 // Doing this last is faster, according to benchmarks.
34157 /// you need first when navigating forward (or last when navigating backward).
34170 /// you need last when navigating forward (or first when navigating backward).
34676 assert_eq!(set.last().unwrap().id(), 2);
34952 assert_eq!(a.last(), None);
34955 assert_eq!(a.last(), Some(&1));
34958 assert_eq!(a.last(), Some(&2));
34963 assert_eq!(a.last(), Some(&12));
35730 // - 5 elements in right child's last grandchild
36143 let (first, last) = (vec![all[0]], vec![all[size as usize - 1]]);
36176 assert_eq!(range_keys(&map, (Excluded(size - 1), Excluded(size + 1))), last);
36177 assert_eq!(range_keys(&map, (Excluded(size - 1), Included(size + 1))), last);
36178 assert_eq!(range_keys(&map, (Excluded(size - 1), Included(size))), last);
36179 assert_eq!(range_keys(&map, (Excluded(size - 1), Unbounded)), last);
36180 assert_eq!(range_keys(&map, (Included(size), Excluded(size + 1))), last);
36181 assert_eq!(range_keys(&map, (Included(size), Included(size + 1))), last);
36182 assert_eq!(range_keys(&map, (Included(size), Included(size))), last);
36183 assert_eq!(range_keys(&map, (Included(size), Unbounded)), last);
36222 let (first, last) = (vec![all[0]], vec![all[size as usize - 1]]);
36255 assert_eq!(range_keys(&map, (Excluded(size - 1), Excluded(size + 1))), last);
36256 assert_eq!(range_keys(&map, (Excluded(size - 1), Included(size + 1))), last);
36257 assert_eq!(range_keys(&map, (Excluded(size - 1), Included(size))), last);
36258 assert_eq!(range_keys(&map, (Excluded(size - 1), Unbounded)), last);
36259 assert_eq!(range_keys(&map, (Included(size), Excluded(size + 1))), last);
36260 assert_eq!(range_keys(&map, (Included(size), Included(size + 1))), last);
36261 assert_eq!(range_keys(&map, (Included(size), Included(size))), last);
36262 assert_eq!(range_keys(&map, (Included(size), Unbounded)), last);
37586 // In a tree with 3 levels, if only part of the last leaf node is split off,
37591 let last = MIN_INSERTS_HEIGHT_2 - 1;
37593 assert_eq!(*left.last_key_value().unwrap().0, last);
37594 let right = left.split_off(&last);
37599 assert_eq!(*left.last_key_value().unwrap().0, last - 1);
37600 assert_eq!(*right.last_key_value().unwrap().0, last);
41748 /// Removes the last element from the `VecDeque` and returns it, or `None` if
41864 /// last element.
42045 // copy last element into empty spot at bottom of buffer
42069 // copy last element into empty spot at bottom of buffer
42089 // copy last element into empty spot at bottom of buffer
42286 // copy last element into empty spot
42289 // move elements from tail to end forward, excluding the last one
42690 /// - Pops the last `k` items and pushes them to the front.
43381 fn last(mut self) -> Option<&'a T> {
44204 fn last(mut self) -> Option<&'a mut T> {
45493 fn last(self) -> Option<&'a T> {
45494 self.iter.last()
46764 /// collected. `end` is the last writable element of the allocation and used for bounds checks.
48051 /// The removed element is replaced by the last element of the vector.
48084 // We replace self[index] with the last element. Note that if the
48085 // bounds check above succeeds there must be a last element (which
48087 let last = ptr::read(self.as_ptr().add(len - 1));
48090 ptr::replace(hole, last)
48453 /// Removes the last element from a vector and returns it, or [`None`] if it
48965 fn last(self) -> T;
48973 fn last(self) -> T {
48983 fn last(self) -> T {
48993 fn last(mut self) -> T {
49010 // Write all elements except the last one
49019 // We can write the last element directly without cloning needlessly
49020 ptr::write(ptr, value.last());
49854 // is required to prevent a double-drop of the last successfully
51658 fn last(self) -> Option<I::Item> {
51659 BoxIter::last(self)
51665 fn last(self) -> Option<Self::Item>;
51670 default fn last(self) -> Option<I::Item> {
51680 /// Specialization for sized `I`s that uses `I`s implementation of `last()`
51684 fn last(self) -> Option<I::Item> {
51685 (*self).last()