Skip to content

Commit 694c82c

Browse files
committed
clippy errors fixed
1 parent 9f1e1da commit 694c82c

File tree

7 files changed

+20
-20
lines changed

7 files changed

+20
-20
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "orx-linked-list"
3-
version = "3.2.0"
3+
version = "3.3.0"
44
edition = "2021"
55
authors = ["orxfun <[email protected]>"]
66
description = "A linked list implementation with unique features and an extended list of constant time methods providing high performance traversals and mutations."
@@ -14,10 +14,10 @@ orx-pseudo-default = { version = "1.4", default-features = false }
1414
orx-pinned-vec = "3.11"
1515
orx-split-vec = "3.11"
1616
orx-fixed-vec = "3.11"
17-
orx-selfref-col = "2.2"
17+
orx-selfref-col = "2.3"
1818

1919
[dev-dependencies]
20-
clap = { version = "4.5.17", features = ["derive"] }
20+
clap = { version = "4.5.27", features = ["derive"] }
2121
criterion = "0.5"
2222
rand = "0.8.5"
2323
rand_chacha = "0.3.1"

src/list/ends_traits/doubly_ends.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ where
3939
{
4040
self.ends()
4141
.get(FRONT_IDX)
42-
.map(|p| unsafe { self.col().data_unchecked(&p) })
42+
.map(|p| unsafe { self.col().data_unchecked(p) })
4343
}
4444

4545
/// ***O(1)*** Returns a reference to the back of the list.
@@ -72,7 +72,7 @@ where
7272
{
7373
self.ends()
7474
.get(BACK_IDX)
75-
.map(|p| unsafe { self.col().data_unchecked(&p) })
75+
.map(|p| unsafe { self.col().data_unchecked(p) })
7676
}
7777

7878
// idx
@@ -529,7 +529,7 @@ where
529529
fn next_idx_of(&self, idx: &DoublyIdx<T>) -> Option<DoublyIdx<T>> {
530530
let ptr = self.col().try_get_ptr(idx).expect(IDX_ERR);
531531
let next_ptr = self.col().node(&ptr).next().get();
532-
next_ptr.map(|p| DoublyIdx::new(self.col().memory_state(), &p))
532+
next_ptr.map(|p| DoublyIdx::new(self.col().memory_state(), p))
533533
}
534534

535535
/// ***O(1)*** Returns the element succeeding the one with the given `idx`.
@@ -596,7 +596,7 @@ where
596596
fn prev_idx_of(&self, idx: &DoublyIdx<T>) -> Option<DoublyIdx<T>> {
597597
let ptr = self.col().try_get_ptr(idx).expect(IDX_ERR);
598598
let prev_ptr = self.col().node(&ptr).prev().get();
599-
prev_ptr.map(|p| DoublyIdx::new(self.col().memory_state(), &p))
599+
prev_ptr.map(|p| DoublyIdx::new(self.col().memory_state(), p))
600600
}
601601

602602
/// ***O(1)*** Returns the element preceding the one with the given `idx`.

src/list/ends_traits/doubly_ends_mut.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ where
699699
/// ```
700700
fn move_to_front(&mut self, idx: &DoublyIdx<T>) {
701701
let ptr = self.ends().get(FRONT_IDX).expect(OOB);
702-
let idx_target = NodeIdx::new(self.col().memory_state(), &ptr);
702+
let idx_target = NodeIdx::new(self.col().memory_state(), ptr);
703703
self.move_prev_to(idx, &idx_target);
704704
}
705705

@@ -731,7 +731,7 @@ where
731731
/// ```
732732
fn move_to_back(&mut self, idx: &DoublyIdx<T>) {
733733
let ptr = self.ends().get(BACK_IDX).expect(OOB);
734-
let idx_target = NodeIdx::new(self.col().memory_state(), &ptr);
734+
let idx_target = NodeIdx::new(self.col().memory_state(), ptr);
735735
self.move_next_to(idx, &idx_target);
736736
}
737737

src/list/ends_traits/singly_ends.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ where
3535
{
3636
self.ends()
3737
.get()
38-
.map(|p| unsafe { self.col().data_unchecked(&p) })
38+
.map(|p| unsafe { self.col().data_unchecked(p) })
3939
}
4040

4141
// idx
@@ -492,7 +492,7 @@ where
492492
fn next_idx_of(&self, idx: &SinglyIdx<T>) -> Option<SinglyIdx<T>> {
493493
let ptr = self.col().try_get_ptr(idx).expect(IDX_ERR);
494494
let next_ptr = self.col().node(&ptr).next().get();
495-
next_ptr.map(|p| SinglyIdx::new(self.col().memory_state(), &p))
495+
next_ptr.map(|p| SinglyIdx::new(self.col().memory_state(), p))
496496
}
497497

498498
/// ***O(1)*** Returns the element succeeding the one with the given `idx`.

src/memory/doubly_reclaimer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ fn swap<P, T>(
6666
}
6767

6868
if let Some(prev) = (unsafe { &*occupied }).prev().get() {
69-
col.node_mut(&prev).next_mut().set(node_ptr(vacant));
69+
col.node_mut(prev).next_mut().set(node_ptr(vacant));
7070
}
7171

7272
if let Some(next) = (unsafe { &*occupied }).next().get() {
73-
col.node_mut(&next).prev_mut().set(node_ptr(vacant));
73+
col.node_mut(next).prev_mut().set(node_ptr(vacant));
7474
}
7575

7676
core::mem::swap(unsafe { &mut *(vacant as *mut Node<Doubly<T>>) }, unsafe {

src/tests/doubly.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ where
3939
assert_eq!(self.0.ends().get(BACK_IDX), self.0.ends().get(FRONT_IDX));
4040

4141
let front_ptr = self.0.ends().get(FRONT_IDX).unwrap();
42-
assert!(self.next(&front_ptr).is_none());
43-
assert!(self.prev(&front_ptr).is_none());
42+
assert!(self.next(front_ptr).is_none());
43+
assert!(self.prev(front_ptr).is_none());
4444

4545
let back_ptr = self.0.ends().get(BACK_IDX).unwrap();
46-
assert!(self.next(&back_ptr).is_none());
47-
assert!(self.prev(&back_ptr).is_none());
46+
assert!(self.next(back_ptr).is_none());
47+
assert!(self.prev(back_ptr).is_none());
4848
}
4949
_ => {
5050
assert!(self.front().is_some());
@@ -111,14 +111,14 @@ where
111111

112112
fn next(&self, ptr: &NodePtr<Doubly<T>>) -> Option<PtrAndNode<T>> {
113113
self.0.node(ptr).next().get().map(|p| {
114-
let next_node = self.0.node(&p);
114+
let next_node = self.0.node(p);
115115
(p.clone(), next_node)
116116
})
117117
}
118118

119119
fn prev(&self, ptr: &NodePtr<Doubly<T>>) -> Option<PtrAndNode<T>> {
120120
self.0.node(ptr).prev().get().map(|p| {
121-
let prev_node = self.0.node(&p);
121+
let prev_node = self.0.node(p);
122122
(p.clone(), prev_node)
123123
})
124124
}

src/tests/singly.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ where
3333
assert!(self.front().is_some());
3434

3535
let front_ptr = self.0.ends().get().unwrap();
36-
assert!(self.next(&front_ptr).is_none());
36+
assert!(self.next(front_ptr).is_none());
3737
}
3838
_ => {
3939
assert!(self.front().is_some());

0 commit comments

Comments
 (0)