mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-12 17:41:22 +00:00
.cargo: Run clippy
on ALL the source files (#2949)
This commit is contained in:
@ -582,11 +582,8 @@ mod tests {
|
||||
|
||||
// generate an arbitrary GossipsubMessage using the behaviour signing functionality
|
||||
let config = GossipsubConfig::default();
|
||||
let gs: Gossipsub = Gossipsub::new(
|
||||
crate::MessageAuthenticity::Signed(keypair.0.clone()),
|
||||
config,
|
||||
)
|
||||
.unwrap();
|
||||
let gs: Gossipsub =
|
||||
Gossipsub::new(crate::MessageAuthenticity::Signed(keypair.0), config).unwrap();
|
||||
let data = (0..g.gen_range(10..10024u32))
|
||||
.map(|_| u8::arbitrary(g))
|
||||
.collect::<Vec<_>>();
|
||||
@ -602,8 +599,7 @@ mod tests {
|
||||
fn arbitrary(g: &mut Gen) -> Self {
|
||||
let topic_string: String = (0..g.gen_range(20..1024u32))
|
||||
.map(|_| char::arbitrary(g))
|
||||
.collect::<String>()
|
||||
.into();
|
||||
.collect::<String>();
|
||||
TopicId(Topic::new(topic_string).into())
|
||||
}
|
||||
}
|
||||
@ -654,7 +650,7 @@ mod tests {
|
||||
|
||||
let mut codec = GossipsubCodec::new(codec::UviBytes::default(), ValidationMode::Strict);
|
||||
let mut buf = BytesMut::new();
|
||||
codec.encode(rpc.clone().into_protobuf(), &mut buf).unwrap();
|
||||
codec.encode(rpc.into_protobuf(), &mut buf).unwrap();
|
||||
let decoded_rpc = codec.decode(&mut buf).unwrap().unwrap();
|
||||
// mark as validated as its a published message
|
||||
match decoded_rpc {
|
||||
|
Reference in New Issue
Block a user