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 {
|
impl RouteEntry {
|
||||||
|
#[must_use]
|
||||||
pub fn is_valid(&self) -> bool {
|
pub fn is_valid(&self) -> bool {
|
||||||
Utc::now() < self.ttl
|
Utc::now() < self.ttl
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ pub enum Status {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Status {
|
impl Status {
|
||||||
|
#[must_use]
|
||||||
pub const fn as_str(self) -> &'static str {
|
pub const fn as_str(self) -> &'static str {
|
||||||
match self {
|
match self {
|
||||||
Self::Active => "ACTIVE",
|
Self::Active => "ACTIVE",
|
||||||
|
|
@ -65,6 +66,7 @@ struct ProberInner {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Prober {
|
impl Prober {
|
||||||
|
#[must_use]
|
||||||
pub fn new(alpha: f64) -> Self {
|
pub fn new(alpha: f64) -> Self {
|
||||||
Self {
|
Self {
|
||||||
inner: Arc::new(ProberInner {
|
inner: Arc::new(ProberInner {
|
||||||
|
|
|
||||||
|
|
@ -72,9 +72,11 @@ impl Node {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[must_use]
|
||||||
pub fn id(&self) -> String {
|
pub fn id(&self) -> String {
|
||||||
hex::encode(&self.public_key()[..8])
|
hex::encode(&self.public_key()[..8])
|
||||||
}
|
}
|
||||||
|
#[must_use]
|
||||||
pub fn public_key(&self) -> [u8; 32] {
|
pub fn public_key(&self) -> [u8; 32] {
|
||||||
self.signing_key.verifying_key().to_bytes()
|
self.signing_key.verifying_key().to_bytes()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -99,6 +99,7 @@ pub fn get() -> &'static Metrics {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[must_use]
|
||||||
pub fn gather() -> String {
|
pub fn gather() -> String {
|
||||||
let mut buf = Vec::new();
|
let mut buf = Vec::new();
|
||||||
let encoder = TextEncoder::new();
|
let encoder = TextEncoder::new();
|
||||||
|
|
|
||||||
|
|
@ -164,6 +164,7 @@ impl NarInfo {
|
||||||
Ok(narinfo)
|
Ok(narinfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[must_use]
|
||||||
pub fn fingerprint(&self) -> String {
|
pub fn fingerprint(&self) -> String {
|
||||||
let refs = self
|
let refs = self
|
||||||
.references
|
.references
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,7 @@ struct RaceResult {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Router {
|
impl Router {
|
||||||
|
#[must_use]
|
||||||
pub fn new(
|
pub fn new(
|
||||||
db: Db,
|
db: Db,
|
||||||
prober: Prober,
|
prober: Prober,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue