Skip to content

Commit fd7776c

Browse files
committed
---
yaml --- r: 236405 b: refs/heads/auto c: 97f2a32 h: refs/heads/master i: 236403: 22c19f0 v: v3
1 parent 9f5d77e commit fd7776c

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: e9946f99b97fa1efda39b657448aae0238b66220
11+
refs/heads/auto: 97f2a325644eb88b50fb5b52e09933535fa29c40
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/src/libcollections/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
#![feature(unsafe_no_drop_flag, filling_drop)]
6363
#![feature(decode_utf16)]
6464
#![feature(utf8_error)]
65-
#![cfg_attr(test, feature(rand, test))]
65+
#![cfg_attr(test, feature(clone_from_slice, rand, test))]
6666

6767
#![feature(no_std)]
6868
#![no_std]

branches/auto/src/libcollections/vec.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,19 +1007,15 @@ impl<T:Clone> Clone for Vec<T> {
10071007

10081008
fn clone_from(&mut self, other: &Vec<T>) {
10091009
// drop anything in self that will not be overwritten
1010-
if self.len() > other.len() {
1011-
self.truncate(other.len())
1012-
}
1010+
self.truncate(other.len());
1011+
let len = self.len();
10131012

10141013
// reuse the contained values' allocations/resources.
1015-
for (place, thing) in self.iter_mut().zip(other) {
1016-
place.clone_from(thing)
1017-
}
1014+
self.clone_from_slice(&other[..len]);
10181015

10191016
// self.len <= other.len due to the truncate above, so the
10201017
// slice here is always in-bounds.
1021-
let slice = &other[self.len()..];
1022-
self.push_all(slice);
1018+
self.push_all(&other[len..]);
10231019
}
10241020
}
10251021

0 commit comments

Comments
 (0)