diff options
| author | Tim Diekmann <tim.diekmann@3dvision.de> | 2020-03-25 18:46:01 +0100 |
|---|---|---|
| committer | Tim Diekmann <tim.diekmann@3dvision.de> | 2020-03-26 17:13:25 +0100 |
| commit | b02e53f197566a88e175cddbf1e9c338744fd51a (patch) | |
| tree | d8a2c313e8c5b2c8eb91bf5a29415ebdcfe40853 /src/liballoc | |
| parent | ad7de67a32d40360ad36d03845c5a7004ba68150 (diff) | |
| download | rust-b02e53f197566a88e175cddbf1e9c338744fd51a.tar.gz rust-b02e53f197566a88e175cddbf1e9c338744fd51a.zip | |
Remove check for ZST in `RawVec::needs_to_grow`
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/raw_vec.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/liballoc/raw_vec.rs b/src/liballoc/raw_vec.rs index 79dfa7b6b45..efb7d4cae5d 100644 --- a/src/liballoc/raw_vec.rs +++ b/src/liballoc/raw_vec.rs @@ -461,8 +461,7 @@ impl<T, A: AllocRef> RawVec<T, A> { /// Returns if the buffer needs to grow to fulfill the needed extra capacity. /// Mainly used to make inlining reserve-calls possible without inlining `grow`. fn needs_to_grow(&self, used_capacity: usize, needed_extra_capacity: usize) -> bool { - mem::size_of::<T>() != 0 - && needed_extra_capacity > self.capacity().wrapping_sub(used_capacity) + needed_extra_capacity > self.capacity().wrapping_sub(used_capacity) } fn capacity_from_bytes(excess: usize) -> usize { |
