@@ -30,21 +30,21 @@ pub trait Idx: 'static {
3030///
3131/// In other words, `T` is the type used to index into the bitvector
3232/// this type uses to represent the set of object it holds.
33- pub struct OwnIdxSet < T : Idx > {
33+ pub struct IdxSetBuf < T : Idx > {
3434 _pd : PhantomData < fn ( & T ) > ,
3535 bits : Vec < Word > ,
3636}
3737
38- impl < T : Idx > Clone for OwnIdxSet < T > {
38+ impl < T : Idx > Clone for IdxSetBuf < T > {
3939 fn clone ( & self ) -> Self {
40- OwnIdxSet { _pd : PhantomData , bits : self . bits . clone ( ) }
40+ IdxSetBuf { _pd : PhantomData , bits : self . bits . clone ( ) }
4141 }
4242}
4343
4444// pnkfelix wants to have this be `IdxSet<T>([Word]) and then pass
4545// around `&mut IdxSet<T>` or `&IdxSet<T>`.
4646//
47- // WARNING: Mapping a `&OwnIdxSet <T>` to `&IdxSet<T>` (at least today)
47+ // WARNING: Mapping a `&IdxSetBuf <T>` to `&IdxSet<T>` (at least today)
4848// requires a transmute relying on representation guarantees that may
4949// not hold in the future.
5050
@@ -58,19 +58,19 @@ pub struct IdxSet<T: Idx> {
5858 bits : [ Word ] ,
5959}
6060
61- impl < T : Idx > fmt:: Debug for OwnIdxSet < T > {
61+ impl < T : Idx > fmt:: Debug for IdxSetBuf < T > {
6262 fn fmt ( & self , w : & mut fmt:: Formatter ) -> fmt:: Result { self . bits . fmt ( w) }
6363}
6464
6565impl < T : Idx > fmt:: Debug for IdxSet < T > {
6666 fn fmt ( & self , w : & mut fmt:: Formatter ) -> fmt:: Result { self . bits . fmt ( w) }
6767}
6868
69- impl < T : Idx > OwnIdxSet < T > {
69+ impl < T : Idx > IdxSetBuf < T > {
7070 fn new ( init : Word , universe_size : usize ) -> Self {
7171 let bits_per_word = mem:: size_of :: < Word > ( ) * 8 ;
7272 let num_words = ( universe_size + ( bits_per_word - 1 ) ) / bits_per_word;
73- OwnIdxSet {
73+ IdxSetBuf {
7474 _pd : Default :: default ( ) ,
7575 bits : vec ! [ init; num_words] ,
7676 }
@@ -97,22 +97,22 @@ impl<T: Idx> IdxSet<T> {
9797 }
9898}
9999
100- impl < T : Idx > Deref for OwnIdxSet < T > {
100+ impl < T : Idx > Deref for IdxSetBuf < T > {
101101 type Target = IdxSet < T > ;
102102 fn deref ( & self ) -> & IdxSet < T > {
103103 unsafe { IdxSet :: from_slice ( & self . bits [ ..] ) }
104104 }
105105}
106106
107- impl < T : Idx > DerefMut for OwnIdxSet < T > {
107+ impl < T : Idx > DerefMut for IdxSetBuf < T > {
108108 fn deref_mut ( & mut self ) -> & mut IdxSet < T > {
109109 unsafe { IdxSet :: from_slice_mut ( & mut self . bits [ ..] ) }
110110 }
111111}
112112
113113impl < T : Idx > IdxSet < T > {
114- pub fn to_owned ( & self ) -> OwnIdxSet < T > {
115- OwnIdxSet {
114+ pub fn to_owned ( & self ) -> IdxSetBuf < T > {
115+ IdxSetBuf {
116116 _pd : Default :: default ( ) ,
117117 bits : self . bits . to_owned ( ) ,
118118 }
0 commit comments