chore: fix clippy
This commit is contained in:
@@ -11,6 +11,12 @@ pub struct Handlers<Op> {
|
|||||||
handlers: HashMap<u8, Box<dyn MessageHandler<Op>>>,
|
handlers: HashMap<u8, Box<dyn MessageHandler<Op>>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<Op> Default for Handlers<Op> {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self::new()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<Op> Handlers<Op> {
|
impl<Op> Handlers<Op> {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Self {
|
Self {
|
||||||
|
|||||||
@@ -27,6 +27,12 @@ pub struct MessageReader {
|
|||||||
buffer: VecDeque<u8>,
|
buffer: VecDeque<u8>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for MessageReader {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self::new()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl MessageReader {
|
impl MessageReader {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Self {
|
Self {
|
||||||
|
|||||||
@@ -37,6 +37,12 @@ pub struct Message {
|
|||||||
pointer: usize,
|
pointer: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for Message {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self::new()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl Message {
|
impl Message {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Self {
|
Self {
|
||||||
|
|||||||
@@ -498,10 +498,10 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn test_stream_processor_new() {
|
fn test_stream_processor_new() {
|
||||||
let processor = StreamProcessor::new(true, 123);
|
let processor = StreamProcessor::new(true, 123);
|
||||||
assert_eq!(processor.no_pierce, true);
|
assert!(processor.no_pierce);
|
||||||
assert_eq!(processor.token, 123);
|
assert_eq!(processor.token, 123);
|
||||||
assert_eq!(processor.total_bytes, 0);
|
assert_eq!(processor.total_bytes, 0);
|
||||||
assert_eq!(processor.received, false);
|
assert!(!processor.received);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
@@ -55,6 +55,12 @@ pub struct Context {
|
|||||||
rooms: Rooms,
|
rooms: Rooms,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for Context {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self::new()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl Context {
|
impl Context {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Self {
|
Self {
|
||||||
|
|||||||
Reference in New Issue
Block a user