We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 75b0a68 commit a5734caCopy full SHA for a5734ca
src/liballoc/boxed.rs
@@ -1090,6 +1090,14 @@ impl<T: Clone> Clone for Box<[T]> {
1090
fn clone(&self) -> Self {
1091
self.to_vec().into_boxed_slice()
1092
}
1093
+
1094
+ fn clone_from(&mut self, other: &Self) {
1095
+ if self.len() == other.len() {
1096
+ self.clone_from_slice(&other);
1097
+ } else {
1098
+ *self = other.clone();
1099
+ }
1100
1101
1102
1103
#[stable(feature = "box_borrow", since = "1.1.0")]
0 commit comments