mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-22 22:31:33 +00:00
chore: apply suggestions from beta clippy (#3251)
This commit is contained in:
@ -284,7 +284,7 @@ impl<N: ProtocolName> fmt::Display for DisplayProtocolName<N> {
|
||||
if (b' '..=b'~').contains(byte) {
|
||||
f.write_char(char::from(*byte))?;
|
||||
} else {
|
||||
write!(f, "<{:02X}>", byte)?;
|
||||
write!(f, "<{byte:02X}>")?;
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
@ -302,9 +302,9 @@ mod tests {
|
||||
assert_eq!(
|
||||
DisplayProtocolName((0u8..=255).collect::<Vec<_>>()).to_string(),
|
||||
(0..32)
|
||||
.map(|c| format!("<{:02X}>", c))
|
||||
.map(|c| format!("<{c:02X}>"))
|
||||
.chain((32..127).map(|c| format!("{}", char::from_u32(c).unwrap())))
|
||||
.chain((127..256).map(|c| format!("<{:02X}>", c)))
|
||||
.chain((127..256).map(|c| format!("<{c:02X}>")))
|
||||
.collect::<String>()
|
||||
);
|
||||
}
|
||||
|
@ -3678,10 +3678,10 @@ impl fmt::Debug for PublishConfig {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
PublishConfig::Signing { author, .. } => {
|
||||
f.write_fmt(format_args!("PublishConfig::Signing({})", author))
|
||||
f.write_fmt(format_args!("PublishConfig::Signing({author})"))
|
||||
}
|
||||
PublishConfig::Author(author) => {
|
||||
f.write_fmt(format_args!("PublishConfig::Author({})", author))
|
||||
f.write_fmt(format_args!("PublishConfig::Author({author})"))
|
||||
}
|
||||
PublishConfig::RandomAuthor => f.write_fmt(format_args!("PublishConfig::RandomAuthor")),
|
||||
PublishConfig::Anonymous => f.write_fmt(format_args!("PublishConfig::Anonymous")),
|
||||
|
@ -256,13 +256,12 @@ fn custom_event_emit_event_through_poll() {
|
||||
}
|
||||
|
||||
#[allow(dead_code, unreachable_code, clippy::diverging_sub_expression)]
|
||||
fn bar() {
|
||||
async fn bar() {
|
||||
require_net_behaviour::<Foo>();
|
||||
|
||||
let mut _swarm: libp2p_swarm::Swarm<Foo> = unimplemented!();
|
||||
|
||||
// check that the event is bubbled up all the way to swarm
|
||||
let _ = async {
|
||||
loop {
|
||||
match _swarm.select_next_some().await {
|
||||
SwarmEvent::Behaviour(BehaviourOutEvent::Ping(_)) => break,
|
||||
@ -270,7 +269,6 @@ fn custom_event_emit_event_through_poll() {
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user