Skip to content

Commit 2962e7c

Browse files
committed
Auto merge of rust-lang#84209 - pickfire:patch-3, r=jyn514
Merge same condition branch in vec spec_extend Follow up of rust-lang#83726 (comment)
2 parents f1ca558 + eeac70c commit 2962e7c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

library/alloc/src/vec/spec_extend.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,13 @@ where
2626
default fn spec_extend(&mut self, iterator: I) {
2727
// This is the case for a TrustedLen iterator.
2828
let (low, high) = iterator.size_hint();
29-
if let Some(high_value) = high {
29+
if let Some(additional) = high {
3030
debug_assert_eq!(
3131
low,
32-
high_value,
32+
additional,
3333
"TrustedLen iterator's size hint is not exact: {:?}",
3434
(low, high)
3535
);
36-
}
37-
if let Some(additional) = high {
3836
self.reserve(additional);
3937
unsafe {
4038
let mut ptr = self.as_mut_ptr().add(self.len());

0 commit comments

Comments
 (0)