We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f1ca558 + eeac70c commit 2962e7cCopy full SHA for 2962e7c
library/alloc/src/vec/spec_extend.rs
@@ -26,15 +26,13 @@ where
26
default fn spec_extend(&mut self, iterator: I) {
27
// This is the case for a TrustedLen iterator.
28
let (low, high) = iterator.size_hint();
29
- if let Some(high_value) = high {
+ if let Some(additional) = high {
30
debug_assert_eq!(
31
low,
32
- high_value,
+ additional,
33
"TrustedLen iterator's size hint is not exact: {:?}",
34
(low, high)
35
);
36
- }
37
- if let Some(additional) = high {
38
self.reserve(additional);
39
unsafe {
40
let mut ptr = self.as_mut_ptr().add(self.len());
0 commit comments