Skip to content

Commit

Permalink
rust format
Browse files Browse the repository at this point in the history
  • Loading branch information
coastalwhite committed Jul 23, 2024
1 parent e503d21 commit dd022a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions crates/polars-arrow/src/bitmap/immutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,15 +410,15 @@ impl Bitmap {
});

let zero_bytes = rwlock_zero_bytes.upgradable_read();
let bytes = if zero_bytes.len() * 8 < length {
let bytes = if zero_bytes.len() * 8 >= length {
zero_bytes.clone()
} else {
let bytes = Arc::new(Bytes::from(vec![0; length.div_ceil(8)]));

let mut zero_bytes = RwLockUpgradableReadGuard::upgrade(zero_bytes);
*zero_bytes = bytes.clone();

bytes
} else {
zero_bytes.clone()
};

Bitmap {
Expand Down
5 changes: 2 additions & 3 deletions crates/polars-utils/src/foreign_vec.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// This is pulled out of https://github.com/DataEngineeringLabs/foreign_vec

use std::mem::ManuallyDrop;
use std::ops::DerefMut;
use std::vec::Vec;
Expand Down Expand Up @@ -66,11 +65,11 @@ impl<D, T> Drop for ForeignVec<D, T> {
match self.allocation {
Allocation::Foreign(_) => {
// the foreign is dropped via its `Drop`
}
},
Allocation::Native => {
let data = core::mem::take(&mut self.data);
let _ = ManuallyDrop::into_inner(data);
}
},
}
}
}
Expand Down

0 comments on commit dd022a5

Please sign in to comment.