Skip to content

Commit a510948

Browse files
committed
lints
1 parent ade402b commit a510948

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/sstream/sm2.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,7 @@ mod tests {
639639
}
640640
}
641641

642+
#[allow(clippy::type_complexity)]
642643
fn create_mock_io_pair() -> (
643644
MockIo<impl Stream<Item = Result<Vec<u8>, std::io::Error>>>,
644645
mpsc::UnboundedSender<Result<Vec<u8>, std::io::Error>>,
@@ -743,10 +744,10 @@ mod tests {
743744
let (mut lm, mut rm) = connected_machines();
744745

745746
let payload = b"Hello, World!".to_vec();
746-
lm.handshake_start(&payload);
747+
lm.handshake_start(&payload)?;
747748
//let (lres, rres) = join!(lm.send(b"foo"), rm.next()); // TODO this hangs
748749
let (lres, rres) = join!(lm.flush(), rm.next());
749-
assert!(matches!(rres, Some(Event::HandshakePayload(payload))));
750+
assert!(matches!(rres, Some(Event::HandshakePayload(_))));
750751
lres?;
751752
Ok(())
752753
}
@@ -763,14 +764,14 @@ mod tests {
763764
};
764765

765766
let (empty, rtol, ltor): (Vec<u8>, _, _) = (vec![], b"rtol".to_vec(), b"ltor".to_vec());
766-
assert!(matches!(lr, Event::HandshakePayload(empty)));
767-
assert!(matches!(rr, Event::HandshakePayload(empty)));
767+
assert!(matches!(lr, Event::HandshakePayload(x) if x == empty));
768+
assert!(matches!(rr, Event::HandshakePayload(x) if x == empty));
768769

769770
let (Some(lr), Some(rr)) = join!(lm.next(), rm.next()) else {
770771
panic!()
771772
};
772-
assert!(matches!(lr, Event::Message(rtol)));
773-
assert!(matches!(rr, Event::Message(ltor)));
773+
assert!(matches!(lr, Event::Message(x) if x == rtol));
774+
assert!(matches!(rr, Event::Message(x) if x == ltor));
774775

775776
Ok(())
776777
}

0 commit comments

Comments
 (0)