Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
eggyal committed Dec 31, 2022
1 parent 075c689 commit 1ce160b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 25 deletions.
24 changes: 3 additions & 21 deletions src/btree/map/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1677,32 +1677,14 @@ fn test_clone_panic_leak(size: usize) {

catch_unwind(|| map.clone()).unwrap_err();
for d in &dummies {
assert_eq!(
d.cloned(),
usize::from(d.id <= i),
"id={}/{}",
d.id,
i
);
assert_eq!(
d.dropped(),
usize::from(d.id < i),
"id={}/{}",
d.id,
i
);
assert_eq!(d.cloned(), usize::from(d.id <= i), "id={}/{}", d.id, i);
assert_eq!(d.dropped(), usize::from(d.id < i), "id={}/{}", d.id, i);
}
assert_eq!(map.len(), size);

drop(map);
for d in &dummies {
assert_eq!(
d.cloned(),
usize::from(d.id <= i),
"id={}/{}",
d.id,
i
);
assert_eq!(d.cloned(), usize::from(d.id <= i), "id={}/{}", d.id, i);
assert_eq!(
d.dropped(),
if d.id < i { 2 } else { 1 },
Expand Down
6 changes: 5 additions & 1 deletion src/btree/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,11 @@ impl<'a, K: 'a, V: 'a> NodeRef<marker::Mut<'a>, K, V, marker::Internal> {
impl<'a, K, V, Type> NodeRef<marker::ValMut<'a>, K, V, Type> {
/// # Safety
/// - The node has more than `idx` initialized elements.
#[allow(clippy::needless_borrow, clippy::borrow_deref_ref, unstable_name_collisions)]
#[allow(
clippy::needless_borrow,
clippy::borrow_deref_ref,
unstable_name_collisions
)]
unsafe fn into_key_val_mut_at(self, idx: usize) -> (&'a K, &'a mut V) {
// We only create a reference to the one element we are interested in,
// to avoid aliasing with outstanding references to other elements,
Expand Down
4 changes: 1 addition & 3 deletions src/polyfill.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#[macro_use]
#[allow(unstable_name_collisions)]
mod definitions {

use cfg_if::cfg_if;

#[cfg(not(all(feature = "allocator_api", feature = "new_uninit")))]
use alloc::alloc::Layout;
use cfg_if::cfg_if;
use core::mem::MaybeUninit;

cfg_if! {
Expand Down

0 comments on commit 1ce160b

Please sign in to comment.