Lines Matching defs:other
240 /// A `Vec` can be mutable. On the other hand, slices are read-only objects.
1423 /// is serving as a buffer for other code, particularly over FFI:
1647 /// In other words, remove all elements `e` for which `f(&e)` returns `false`.
1679 /// In other words, remove all elements `e` such that `f(&mut e)` returns `false`.
2052 /// Moves all the elements of `other` into `self`, leaving `other` empty.
2070 pub fn append(&mut self, other: &mut Self) {
2072 self.append_elements(other.as_slice() as _);
2073 other.set_len(0);
2077 /// Appends elements to `self` from other buffer.
2080 unsafe fn append_elements(&mut self, other: *const [T]) {
2081 let count = unsafe { (*other).len() };
2084 unsafe { ptr::copy_nonoverlapping(other as *const T, self.as_mut_ptr().add(len), count) };
2088 /// Tries to append elements to `self` from other buffer.
2090 unsafe fn try_append_elements(&mut self, other: *const [T]) -> Result<(), TryReserveError> {
2091 let count = unsafe { (*other).len() };
2094 unsafe { ptr::copy_nonoverlapping(other as *const T, self.as_mut_ptr().add(len), count) };
2242 #[must_use = "use `.truncate()` if you don't need the other half"]
2267 let mut other = Vec::with_capacity_in(other_len, self.allocator().clone());
2269 // Unsafely `set_len` and copy items to `other`.
2272 other.set_len(other_len);
2274 ptr::copy_nonoverlapping(self.as_ptr().add(at), other.as_mut_ptr(), other.len());
2276 other
2558 /// Iterates over the slice `other`, clones each element, and then appends
2559 /// it to this `Vec`. The `other` slice is traversed in-order.
2577 pub fn extend_from_slice(&mut self, other: &[T]) {
2578 self.spec_extend(other.iter())
2583 /// Iterates over the slice `other`, clones each element, and then appends
2584 /// it to this `Vec`. The `other` slice is traversed in-order.
2601 pub fn try_extend_from_slice(&mut self, other: &[T]) -> Result<(), TryReserveError> {
2602 self.try_spec_extend(other.iter())
2886 fn clone_from(&mut self, other: &Self) {
2887 crate::slice::SpecCloneIntoVec::clone_into(other.as_slice(), self);
3112 // Since the other branch already panics eagerly (via `reserve()`) we do the same here.
3291 fn partial_cmp(&self, other: &Vec<T, A2>) -> Option<Ordering> {
3292 PartialOrd::partial_cmp(&**self, &**other)
3303 fn cmp(&self, other: &Self) -> Ordering {
3304 Ord::cmp(&**self, &**other)