mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Fix Rust 1.83 Clippy lints (#6629)
* Fix Rust 1.83 Clippy lints * Cargo fmt
This commit is contained in:
@@ -48,8 +48,7 @@ pub(crate) struct BackoffStorage {
|
||||
|
||||
impl BackoffStorage {
|
||||
fn heartbeats(d: &Duration, heartbeat_interval: &Duration) -> usize {
|
||||
((d.as_nanos() + heartbeat_interval.as_nanos() - 1) / heartbeat_interval.as_nanos())
|
||||
as usize
|
||||
d.as_nanos().div_ceil(heartbeat_interval.as_nanos()) as usize
|
||||
}
|
||||
|
||||
pub(crate) fn new(
|
||||
|
||||
@@ -63,7 +63,7 @@ impl<'de> Deserialize<'de> for PeerIdSerialized {
|
||||
// A wrapper struct that prints a dial error nicely.
|
||||
struct ClearDialError<'a>(&'a DialError);
|
||||
|
||||
impl<'a> ClearDialError<'a> {
|
||||
impl ClearDialError<'_> {
|
||||
fn most_inner_error(err: &(dyn std::error::Error)) -> &(dyn std::error::Error) {
|
||||
let mut current = err;
|
||||
while let Some(source) = current.source() {
|
||||
@@ -73,7 +73,7 @@ impl<'a> ClearDialError<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> std::fmt::Display for ClearDialError<'a> {
|
||||
impl std::fmt::Display for ClearDialError<'_> {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> {
|
||||
match &self.0 {
|
||||
DialError::Transport(errors) => {
|
||||
|
||||
Reference in New Issue
Block a user