various: auto-fix clippy warnings
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Ia8f0b1ebd657bb9cdebef9d62413f45a6a6a6964
This commit is contained in:
parent
49545fdb6b
commit
b1f3b4b1ff
6 changed files with 8 additions and 0 deletions
|
|
@ -32,6 +32,7 @@ pub struct RouteEntry {
|
|||
}
|
||||
|
||||
impl RouteEntry {
|
||||
#[must_use]
|
||||
pub fn is_valid(&self) -> bool {
|
||||
Utc::now() < self.ttl
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ pub enum Status {
|
|||
}
|
||||
|
||||
impl Status {
|
||||
#[must_use]
|
||||
pub const fn as_str(self) -> &'static str {
|
||||
match self {
|
||||
Self::Active => "ACTIVE",
|
||||
|
|
@ -65,6 +66,7 @@ struct ProberInner {
|
|||
}
|
||||
|
||||
impl Prober {
|
||||
#[must_use]
|
||||
pub fn new(alpha: f64) -> Self {
|
||||
Self {
|
||||
inner: Arc::new(ProberInner {
|
||||
|
|
|
|||
|
|
@ -72,9 +72,11 @@ impl Node {
|
|||
})
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn id(&self) -> String {
|
||||
hex::encode(&self.public_key()[..8])
|
||||
}
|
||||
#[must_use]
|
||||
pub fn public_key(&self) -> [u8; 32] {
|
||||
self.signing_key.verifying_key().to_bytes()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@ pub fn get() -> &'static Metrics {
|
|||
})
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn gather() -> String {
|
||||
let mut buf = Vec::new();
|
||||
let encoder = TextEncoder::new();
|
||||
|
|
|
|||
|
|
@ -164,6 +164,7 @@ impl NarInfo {
|
|||
Ok(narinfo)
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn fingerprint(&self) -> String {
|
||||
let refs = self
|
||||
.references
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ struct RaceResult {
|
|||
}
|
||||
|
||||
impl Router {
|
||||
#[must_use]
|
||||
pub fn new(
|
||||
db: Db,
|
||||
prober: Prober,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue