From cb76e71b90975f2626b1c3ef3f57ae08dda1484d Mon Sep 17 00:00:00 2001 From: Alex Helfet Date: Tue, 28 Jan 2020 23:16:04 +0000 Subject: [PATCH] Fix build errors. --- framed/src/bytes.rs | 10 +++++----- framed/src/typed.rs | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/framed/src/bytes.rs b/framed/src/bytes.rs index befbd18..5301d07 100644 --- a/framed/src/bytes.rs +++ b/framed/src/bytes.rs @@ -336,7 +336,7 @@ impl Codec { /// Reads bytes from the supplied `Read` until it has a complete /// encoded frame, then decodes the frame, returning the payload on the heap. #[cfg(feature = "use_std")] - pub fn decode_from_reader(&mut self, r: &mut Read) + pub fn decode_from_reader(&mut self, r: &mut dyn Read) -> Result { // Read until FRAME_END_SYMBOL let mut next_frame = Vec::new(); @@ -544,7 +544,7 @@ mod tests { #[test] #[should_panic] fn encode_to_slice_dest_too_small() { - let mut encoded_buf = [0u8; PAYLOAD_LEN];; + let mut encoded_buf = [0u8; PAYLOAD_LEN]; let _ = codec().encode_to_slice(&PAYLOAD, &mut encoded_buf); } @@ -810,11 +810,11 @@ mod rw_tests { Config::default() } - fn pair() -> (Sender>, Receiver>) { + fn pair() -> (Sender>, Receiver>) { let chan = Channel::new(); let c = config(); - let tx = c.clone().to_sender(Box::new(chan.writer()) as Box); - let rx = c.clone().to_receiver(Box::new(chan.reader()) as Box); + let tx = c.clone().to_sender(Box::new(chan.writer()) as Box); + let rx = c.clone().to_receiver(Box::new(chan.reader()) as Box); (tx, rx) } } diff --git a/framed/src/typed.rs b/framed/src/typed.rs index f83cf4e..b44016f 100644 --- a/framed/src/typed.rs +++ b/framed/src/typed.rs @@ -488,13 +488,13 @@ mod tests { } } - fn pair() -> (Sender, Test>, Receiver, Test>) { + fn pair() -> (Sender, Test>, Receiver, Test>) { let chan = Channel::new(); let conf = bytes::Config::default().typed::(); let tx = conf.clone() - .to_sender(Box::new(chan.writer()) as Box); + .to_sender(Box::new(chan.writer()) as Box); let rx = conf.clone() - .to_receiver(Box::new(chan.reader()) as Box); + .to_receiver(Box::new(chan.reader()) as Box); (tx, rx) } }