File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
1
//! Provide the intrusive LinkedList
2
- #![ allow( dead_code) ]
3
2
3
+ use core:: marker:: PhantomData ;
4
4
use core:: { fmt, ptr} ;
5
5
6
6
/// An intrusive linked list
@@ -52,7 +52,7 @@ impl LinkedList {
52
52
pub fn iter ( & self ) -> Iter {
53
53
Iter {
54
54
curr : self . head ,
55
- list : self ,
55
+ list : PhantomData ,
56
56
}
57
57
}
58
58
@@ -61,7 +61,7 @@ impl LinkedList {
61
61
IterMut {
62
62
prev : & mut self . head as * mut * mut usize as * mut usize ,
63
63
curr : self . head ,
64
- list : self ,
64
+ list : PhantomData ,
65
65
}
66
66
}
67
67
}
@@ -75,7 +75,7 @@ impl fmt::Debug for LinkedList {
75
75
/// An iterator over the linked list
76
76
pub struct Iter < ' a > {
77
77
curr : * mut usize ,
78
- list : & ' a LinkedList ,
78
+ list : PhantomData < & ' a LinkedList > ,
79
79
}
80
80
81
81
impl < ' a > Iterator for Iter < ' a > {
@@ -117,7 +117,7 @@ impl ListNode {
117
117
118
118
/// A mutable iterator over the linked list
119
119
pub struct IterMut < ' a > {
120
- list : & ' a mut LinkedList ,
120
+ list : PhantomData < & ' a mut LinkedList > ,
121
121
prev : * mut usize ,
122
122
curr : * mut usize ,
123
123
}
You can’t perform that action at this time.
0 commit comments