Skip to content

Commit

Permalink
FIX: Update .retain() optimization for const generics
Browse files Browse the repository at this point in the history
  • Loading branch information
bluss committed Mar 29, 2021
1 parent c094906 commit b82a6d4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/arrayvec.rs
Expand Up @@ -451,14 +451,14 @@ impl<T, const CAP: usize> ArrayVec<T, CAP> {
let original_len = self.len();
unsafe { self.set_len(0) };

struct BackshiftOnDrop<'a, A: Array> {
v: &'a mut ArrayVec<A>,
struct BackshiftOnDrop<'a, T, const CAP: usize> {
v: &'a mut ArrayVec<T, CAP>,
processed_len: usize,
deleted_cnt: usize,
original_len: usize,
}

impl<A: Array> Drop for BackshiftOnDrop<'_, A> {
impl<T, const CAP: usize> Drop for BackshiftOnDrop<'_, T, CAP> {
fn drop(&mut self) {
if self.deleted_cnt > 0 {
unsafe {
Expand Down

0 comments on commit b82a6d4

Please sign in to comment.