various: auto-fix clippy warnings

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ia8f0b1ebd657bb9cdebef9d62413f45a6a6a6964
This commit is contained in:
raf 2026-05-11 13:22:05 +03:00
commit b1f3b4b1ff
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
6 changed files with 8 additions and 0 deletions

View file

@ -32,6 +32,7 @@ pub struct RouteEntry {
}
impl RouteEntry {
#[must_use]
pub fn is_valid(&self) -> bool {
Utc::now() < self.ttl
}

View file

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

View file

@ -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()
}

View file

@ -99,6 +99,7 @@ pub fn get() -> &'static Metrics {
})
}
#[must_use]
pub fn gather() -> String {
let mut buf = Vec::new();
let encoder = TextEncoder::new();

View file

@ -164,6 +164,7 @@ impl NarInfo {
Ok(narinfo)
}
#[must_use]
pub fn fingerprint(&self) -> String {
let refs = self
.references

View file

@ -57,6 +57,7 @@ struct RaceResult {
}
impl Router {
#[must_use]
pub fn new(
db: Db,
prober: Prober,