Lines Matching defs:start
14648 /// Gets a raw pointer to the start of the allocation. Note that this is
15243 for (start, part) in self.match_indices(from) {
15244 result.push_str(unsafe { self.get_unchecked(last_end..start) });
15246 last_end = start + part.len();
15282 for (start, part) in self.match_indices(pat).take(count) {
15283 result.push_str(unsafe { self.get_unchecked(last_end..start) });
15285 last_end = start + part.len();
17417 // SAFETY: start and end will be on utf8 byte boundaries per
17420 for (start, end) in matches {
17423 self.vec.as_mut_ptr().add(start - shrunk_by),
17426 shrunk_by += end - start;
17748 let Range { start, end } = slice::range(range, ..self.len());
17749 assert!(self.is_char_boundary(start));
17756 let chars_iter = unsafe { self.get_unchecked(start..end) }.chars();
17758 Drain { start, end, iter: chars_iter, string: self_ptr }
17793 let start = range.start_bound();
17794 match start {
17810 unsafe { self.as_mut_vec() }.splice((start, end), replace_with.bytes());
18712 start: usize,
18738 if self.start <= self.end && self.end <= self_vec.len() {
18739 self_vec.drain(self.start..self.end);
22911 hole = MergeHole { start: buf, end: buf.add(mid), dest: v };
22915 let left = &mut hole.start;
22935 hole = MergeHole { start: buf, end: buf.add(len - mid), dest: v_mid };
22970 // When dropped, copies the range `start..end` into `dest..`.
22972 start: *mut T,
22980 let len = (self.end as usize - self.start as usize) / mem::size_of::<T>();
22982 ptr::copy_nonoverlapping(self.start, self.dest, len);
23040 let mut start = end - 1;
23041 if start > 0 {
23042 start -= 1;
23044 if is_less(v.get_unchecked(start + 1), v.get_unchecked(start)) {
23045 while start > 0 && is_less(v.get_unchecked(start), v.get_unchecked(start - 1)) {
23046 start -= 1;
23048 v[start..end].reverse();
23050 while start > 0 && !is_less(v.get_unchecked(start), v.get_unchecked(start - 1))
23052 start -= 1;
23060 while start > 0 && end - start < MIN_RUN {
23061 start -= 1;
23062 insert_head(&mut v[start..end], &mut is_less);
23066 runs.push(Run { start, len: end - start });
23067 end = start;
23075 &mut v[left.start..right.start + right.len],
23081 runs[r] = Run { start: left.start, len: left.len + right.len };
23087 debug_assert!(runs.len() == 1 && runs[0].start == 0 && runs[0].len == len);
23107 && (runs[n - 1].start == 0
23120 start: usize,
25845 //! Things can get a little tricky once you start intermingling the two types of
27812 // Below, we iterate towards the `i-1`th node, either from the start or the end,
27863 // the start or the end, depending on which would be faster.
28056 /// When created, cursors start at the front of the list, or the "ghost" non-element if the list is empty.
28122 // We had no current element; the cursor was sitting at the start position
28144 // No current. We're at the start of the list. Yield None and jump to the end.
28219 // We had no current element; the cursor was sitting at the start position
28241 // No current. We're at the start of the list. Yield None and jump to the end.
28393 /// inserted at the start of the `LinkedList`.
29620 let (start, end) = (range.start_bound(), range.end_bound());
29621 match (start, end) {
29623 panic!("range start and end are equal and excluded in BTreeMap")
29628 panic!("range start is greater than range end in BTreeMap")
29632 let mut lower_bound = SearchBound::from_range(start);
30811 /// Panics if range `start > end`.
30812 /// Panics if range `start == end` and both bounds are `Excluded`.
30854 /// Panics if range `start > end`.
30855 /// Panics if range `start == end` and both bounds are `Excluded`.
41423 let Range { start, end } = slice::range(range, ..self.len());
41424 let tail = self.wrap_add(self.tail, start);
41563 // have forgotten about the potentially moved values after the start of
41571 // "forget" about the values after the start of the drain until after
42917 /// This means that all elements for which the predicate returns true are at the start of the deque
42920 /// (all odd numbers are at the start, all even at the end).
43749 for start in 0..=len {
43750 for end in start..=len {
43758 let range: VecDeque<_> = tester.range(start..end).copied().collect();
43759 let expected: VecDeque<_> = (start..end).collect();
43774 for start in 0..=len {
43775 for end in start..=len {
43786 let range: VecDeque<_> = tester.range_mut(start..end).map(|v| *v).collect();
43787 let expected: VecDeque<_> = (start..end).collect();
43969 // Test cases where block at end of buffer is bigger than block at start
43974 // Test cases where block at start of buffer is bigger than block at end
43990 // Test cases where block at end of buffer is bigger than block at start
43995 // Test cases where block at start of buffer is bigger than block at end
44324 //! // Start at `start` and use `dist` to track the current shortest distance
44328 //! fn shortest_path(adj_list: &Vec<Vec<Edge>>, start: usize, goal: usize) -> Option<usize> {
44329 //! // dist[node] = current shortest distance from `start` to `node`
44334 //! // We're at `start`, with a zero cost
44335 //! dist[start] = 0;
44336 //! heap.push(State { cost: 0, position: start });
44801 unsafe fn sift_up(&mut self, start: usize, pos: usize) -> usize {
44806 while hole.pos() > start {
44809 // SAFETY: hole.pos() > start >= 0, which means hole.pos() > 0
44888 let start = pos;
44919 unsafe { self.sift_up(start, pos) };
44922 /// Rebuild assuming data[0..start] is still a proper heap.
44923 fn rebuild_tail(&mut self, start: usize) {
44924 if start == self.len() {
44928 let tail_len = self.len() - start;
44937 // while repeating `sift_up` takes O(tail_len * log(start)) operations
44938 // and about 1 * tail_len * log_2(start) comparisons in the worst case,
44939 // assuming start >= tail_len. For larger heaps, the crossover point
44941 let better_to_rebuild = if start < tail_len {
44944 2 * self.len() < tail_len * log2_fast(start)
44952 for i in start..self.len() {
44996 let start = self.data.len();
45000 self.rebuild_tail(start);
46400 let start = source_vec.len();
46402 if tail != start {
46404 let dst = source_vec.as_mut_ptr().add(start);
46407 source_vec.set_len(start + self.0.tail_len);
48551 let Range { start, end } = slice::range(range, ..len);
48554 // set self.vec length's to start, to be safe in case Drain is leaked
48555 self.set_len(start);
48558 let range_slice = slice::from_raw_parts_mut(self.as_mut_ptr().add(start), end - start);
48856 let Range { start: ptr, end: spare_ptr } = self.as_mut_ptr_range();
49222 /// the vector (from start to end). The vector cannot be used after calling
51884 // before allocation attempts start failing.