Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit f167b0c

Browse files
committed
fixups
1 parent f784500 commit f167b0c

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/packet.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ impl Default for Packet {
6363
}
6464
}
6565

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
6868
// of itself, similar to Default, but not necessarily a full clear
6969
// also, we do it in-place.
70-
fn reset(&mut self) -> ();
70+
fn reset(&mut self);
7171
}
7272

73-
impl Recycle for Packet {
74-
fn reset(&mut self) -> () {
73+
impl Reset for Packet {
74+
fn reset(&mut self) {
7575
self.meta = Meta::default();
7676
}
7777
}
@@ -126,8 +126,8 @@ impl Default for Packets {
126126
}
127127
}
128128

129-
impl Recycle for Packets {
130-
fn reset(&mut self) -> () {
129+
impl Reset for Packets {
130+
fn reset(&mut self) {
131131
for i in 0..self.packets.len() {
132132
self.packets[i].reset();
133133
}
@@ -161,8 +161,8 @@ impl Default for Blob {
161161
}
162162
}
163163

164-
impl Recycle for Blob {
165-
fn reset(&mut self) -> () {
164+
impl Reset for Blob {
165+
fn reset(&mut self) {
166166
self.meta = Meta::default();
167167
self.data[..BLOB_HEADER_SIZE].copy_from_slice(&[0u8; BLOB_HEADER_SIZE]);
168168
}
@@ -194,7 +194,7 @@ impl<T: Default> Clone for Recycler<T> {
194194
}
195195
}
196196

197-
impl<T: Default + Recycle> Recycler<T> {
197+
impl<T: Default + Reset> Recycler<T> {
198198
pub fn allocate(&self) -> Arc<RwLock<T>> {
199199
let mut gc = self.gc.lock().expect("recycler lock in pb fn allocate");
200200

@@ -513,7 +513,7 @@ mod tests {
513513
assert_eq!(r.gc.lock().unwrap().len(), 0);
514514
}
515515

516-
impl Recycle for u8 {
516+
impl Reset for u8 {
517517
fn reset(&mut self) {
518518
*self = Default::default();
519519
}

0 commit comments

Comments
 (0)