Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: remove retain_mut #259

Merged
merged 1 commit into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ license = "MIT OR Apache-2.0"
[dependencies]
bytemuck = "1.7.3"
byteorder = "1.4.3"
retain_mut = "=0.1.7"
serde = { version = "1.0.139", optional = true }

[features]
Expand Down
6 changes: 2 additions & 4 deletions src/bitmap/multiops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ use std::{
ops::{BitOrAssign, BitXorAssign},
};

use retain_mut::RetainMut;

use crate::{MultiOps, RoaringBitmap};

use super::{container::Container, store::Store};
Expand Down Expand Up @@ -229,7 +227,7 @@ fn try_multi_or_owned<E>(
merge_container_owned(&mut containers, bitmap?.containers, BitOrAssign::bitor_assign);
}

RetainMut::retain_mut(&mut containers, |container| {
containers.retain_mut(|container| {
if container.len() > 0 {
container.ensure_correct_store();
true
Expand All @@ -255,7 +253,7 @@ fn try_multi_xor_owned<E>(
merge_container_owned(&mut containers, bitmap?.containers, BitXorAssign::bitxor_assign);
}

RetainMut::retain_mut(&mut containers, |container| {
containers.retain_mut(|container| {
if container.len() > 0 {
container.ensure_correct_store();
true
Expand Down
8 changes: 3 additions & 5 deletions src/bitmap/ops.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use std::mem;
use std::ops::{BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, Sub, SubAssign};

use retain_mut::RetainMut;

use crate::bitmap::container::Container;
use crate::bitmap::Pairs;
use crate::RoaringBitmap;
Expand Down Expand Up @@ -240,7 +238,7 @@ impl BitAndAssign<RoaringBitmap> for RoaringBitmap {
mem::swap(self, &mut rhs);
}

RetainMut::retain_mut(&mut self.containers, |cont| {
self.containers.retain_mut(|cont| {
let key = cont.key;
match rhs.containers.binary_search_by_key(&key, |c| c.key) {
Ok(loc) => {
Expand All @@ -258,7 +256,7 @@ impl BitAndAssign<RoaringBitmap> for RoaringBitmap {
impl BitAndAssign<&RoaringBitmap> for RoaringBitmap {
/// An `intersection` between two sets.
fn bitand_assign(&mut self, rhs: &RoaringBitmap) {
RetainMut::retain_mut(&mut self.containers, |cont| {
self.containers.retain_mut(|cont| {
let key = cont.key;
match rhs.containers.binary_search_by_key(&key, |c| c.key) {
Ok(loc) => {
Expand Down Expand Up @@ -335,7 +333,7 @@ impl SubAssign<RoaringBitmap> for RoaringBitmap {
impl SubAssign<&RoaringBitmap> for RoaringBitmap {
/// A `difference` between two sets.
fn sub_assign(&mut self, rhs: &RoaringBitmap) {
RetainMut::retain_mut(&mut self.containers, |cont| {
self.containers.retain_mut(|cont| {
match rhs.containers.binary_search_by_key(&cont.key, |c| c.key) {
Ok(loc) => {
SubAssign::sub_assign(cont, &rhs.containers[loc]);
Expand Down