Address comments

This commit is contained in:
Noa 2024-04-17 00:18:04 -05:00
parent c0e913fdd7
commit 87db7c32a7
No known key found for this signature in database
GPG Key ID: 7F9F7DB1768C59CF
2 changed files with 2 additions and 4 deletions

View File

@ -116,9 +116,7 @@ impl<T: Clone, A: Allocator + Clone> Clone for VecDeque<T, A> {
/// Overwrites the contents of `self` with a clone of the contents of `source`. /// Overwrites the contents of `self` with a clone of the contents of `source`.
/// ///
/// This method is preferred over simply assigning `source.clone()` to `self`, /// This method is preferred over simply assigning `source.clone()` to `self`,
/// as it avoids reallocation if possible. Additionally, if the element type /// as it avoids reallocation if possible.
/// `T` overrides `clone_from()`, this will reuse the resources of `self`'s
/// elements as well.
fn clone_from(&mut self, source: &Self) { fn clone_from(&mut self, source: &Self) {
self.clear(); self.clear();
self.extend(source.iter().cloned()); self.extend(source.iter().cloned());

View File

@ -1273,7 +1273,7 @@ impl<T: Clone> Clone for RefCell<T> {
/// # Panics /// # Panics
/// ///
/// Panics if `other` is currently mutably borrowed. /// Panics if `source` is currently mutably borrowed.
#[inline] #[inline]
#[track_caller] #[track_caller]
fn clone_from(&mut self, source: &Self) { fn clone_from(&mut self, source: &Self) {