@@ -30,21 +30,21 @@ pub trait Idx: 'static {
30
30
///
31
31
/// In other words, `T` is the type used to index into the bitvector
32
32
/// this type uses to represent the set of object it holds.
33
- pub struct OwnIdxSet < T : Idx > {
33
+ pub struct IdxSetBuf < T : Idx > {
34
34
_pd : PhantomData < fn ( & T ) > ,
35
35
bits : Vec < Word > ,
36
36
}
37
37
38
- impl < T : Idx > Clone for OwnIdxSet < T > {
38
+ impl < T : Idx > Clone for IdxSetBuf < T > {
39
39
fn clone ( & self ) -> Self {
40
- OwnIdxSet { _pd : PhantomData , bits : self . bits . clone ( ) }
40
+ IdxSetBuf { _pd : PhantomData , bits : self . bits . clone ( ) }
41
41
}
42
42
}
43
43
44
44
// pnkfelix wants to have this be `IdxSet<T>([Word]) and then pass
45
45
// around `&mut IdxSet<T>` or `&IdxSet<T>`.
46
46
//
47
- // WARNING: Mapping a `&OwnIdxSet <T>` to `&IdxSet<T>` (at least today)
47
+ // WARNING: Mapping a `&IdxSetBuf <T>` to `&IdxSet<T>` (at least today)
48
48
// requires a transmute relying on representation guarantees that may
49
49
// not hold in the future.
50
50
@@ -58,19 +58,19 @@ pub struct IdxSet<T: Idx> {
58
58
bits : [ Word ] ,
59
59
}
60
60
61
- impl < T : Idx > fmt:: Debug for OwnIdxSet < T > {
61
+ impl < T : Idx > fmt:: Debug for IdxSetBuf < T > {
62
62
fn fmt ( & self , w : & mut fmt:: Formatter ) -> fmt:: Result { self . bits . fmt ( w) }
63
63
}
64
64
65
65
impl < T : Idx > fmt:: Debug for IdxSet < T > {
66
66
fn fmt ( & self , w : & mut fmt:: Formatter ) -> fmt:: Result { self . bits . fmt ( w) }
67
67
}
68
68
69
- impl < T : Idx > OwnIdxSet < T > {
69
+ impl < T : Idx > IdxSetBuf < T > {
70
70
fn new ( init : Word , universe_size : usize ) -> Self {
71
71
let bits_per_word = mem:: size_of :: < Word > ( ) * 8 ;
72
72
let num_words = ( universe_size + ( bits_per_word - 1 ) ) / bits_per_word;
73
- OwnIdxSet {
73
+ IdxSetBuf {
74
74
_pd : Default :: default ( ) ,
75
75
bits : vec ! [ init; num_words] ,
76
76
}
@@ -97,22 +97,22 @@ impl<T: Idx> IdxSet<T> {
97
97
}
98
98
}
99
99
100
- impl < T : Idx > Deref for OwnIdxSet < T > {
100
+ impl < T : Idx > Deref for IdxSetBuf < T > {
101
101
type Target = IdxSet < T > ;
102
102
fn deref ( & self ) -> & IdxSet < T > {
103
103
unsafe { IdxSet :: from_slice ( & self . bits [ ..] ) }
104
104
}
105
105
}
106
106
107
- impl < T : Idx > DerefMut for OwnIdxSet < T > {
107
+ impl < T : Idx > DerefMut for IdxSetBuf < T > {
108
108
fn deref_mut ( & mut self ) -> & mut IdxSet < T > {
109
109
unsafe { IdxSet :: from_slice_mut ( & mut self . bits [ ..] ) }
110
110
}
111
111
}
112
112
113
113
impl < T : Idx > IdxSet < T > {
114
- pub fn to_owned ( & self ) -> OwnIdxSet < T > {
115
- OwnIdxSet {
114
+ pub fn to_owned ( & self ) -> IdxSetBuf < T > {
115
+ IdxSetBuf {
116
116
_pd : Default :: default ( ) ,
117
117
bits : self . bits . to_owned ( ) ,
118
118
}
0 commit comments