.cargo: Run clippy on ALL the source files (#2949)

This commit is contained in:
Thomas Eizinger
2022-10-04 18:24:38 +11:00
committed by GitHub
parent e6da99e4f8
commit 1b793242e6
50 changed files with 5497 additions and 5657 deletions

View File

@ -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 {