@@ -63,15 +63,15 @@ impl Default for Packet {
63
63
}
64
64
}
65
65
66
- pub trait Recycle {
67
- // Recycle trait is an object that can re-initialize important parts
66
+ pub trait Reset {
67
+ // Reset trait is an object that can re-initialize important parts
68
68
// of itself, similar to Default, but not necessarily a full clear
69
69
// also, we do it in-place.
70
- fn reset ( & mut self ) -> ( ) ;
70
+ fn reset ( & mut self ) ;
71
71
}
72
72
73
- impl Recycle for Packet {
74
- fn reset ( & mut self ) -> ( ) {
73
+ impl Reset for Packet {
74
+ fn reset ( & mut self ) {
75
75
self . meta = Meta :: default ( ) ;
76
76
}
77
77
}
@@ -126,8 +126,8 @@ impl Default for Packets {
126
126
}
127
127
}
128
128
129
- impl Recycle for Packets {
130
- fn reset ( & mut self ) -> ( ) {
129
+ impl Reset for Packets {
130
+ fn reset ( & mut self ) {
131
131
for i in 0 ..self . packets . len ( ) {
132
132
self . packets [ i] . reset ( ) ;
133
133
}
@@ -161,8 +161,8 @@ impl Default for Blob {
161
161
}
162
162
}
163
163
164
- impl Recycle for Blob {
165
- fn reset ( & mut self ) -> ( ) {
164
+ impl Reset for Blob {
165
+ fn reset ( & mut self ) {
166
166
self . meta = Meta :: default ( ) ;
167
167
self . data [ ..BLOB_HEADER_SIZE ] . copy_from_slice ( & [ 0u8 ; BLOB_HEADER_SIZE ] ) ;
168
168
}
@@ -194,7 +194,7 @@ impl<T: Default> Clone for Recycler<T> {
194
194
}
195
195
}
196
196
197
- impl < T : Default + Recycle > Recycler < T > {
197
+ impl < T : Default + Reset > Recycler < T > {
198
198
pub fn allocate ( & self ) -> Arc < RwLock < T > > {
199
199
let mut gc = self . gc . lock ( ) . expect ( "recycler lock in pb fn allocate" ) ;
200
200
@@ -513,7 +513,7 @@ mod tests {
513
513
assert_eq ! ( r. gc. lock( ) . unwrap( ) . len( ) , 0 ) ;
514
514
}
515
515
516
- impl Recycle for u8 {
516
+ impl Reset for u8 {
517
517
fn reset ( & mut self ) {
518
518
* self = Default :: default ( ) ;
519
519
}
0 commit comments