mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
Add missing_const_for_fn clippy lint (#8498)
This commit is contained in:
@ -52,7 +52,7 @@ pub struct DnsResolver(TokioAsyncResolver);
|
||||
|
||||
impl DnsResolver {
|
||||
/// Create a new resolver by wrapping the given [AsyncResolver]
|
||||
pub fn new(resolver: TokioAsyncResolver) -> Self {
|
||||
pub const fn new(resolver: TokioAsyncResolver) -> Self {
|
||||
Self(resolver)
|
||||
}
|
||||
|
||||
|
||||
@ -41,11 +41,11 @@ impl<K: EnrKeyUnambiguous> SyncTree<K> {
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub(crate) fn root(&self) -> &TreeRootEntry {
|
||||
pub(crate) const fn root(&self) -> &TreeRootEntry {
|
||||
&self.root
|
||||
}
|
||||
|
||||
pub(crate) fn link(&self) -> &LinkEntry<K> {
|
||||
pub(crate) const fn link(&self) -> &LinkEntry<K> {
|
||||
&self.link
|
||||
}
|
||||
|
||||
@ -156,7 +156,7 @@ pub(crate) enum ResolveKind {
|
||||
// === impl ResolveKind ===
|
||||
|
||||
impl ResolveKind {
|
||||
pub(crate) fn is_link(&self) -> bool {
|
||||
pub(crate) const fn is_link(&self) -> bool {
|
||||
matches!(self, Self::Link)
|
||||
}
|
||||
}
|
||||
|
||||
@ -199,7 +199,7 @@ impl BranchEntry {
|
||||
/// `n` bytes of base32-encoded data.
|
||||
/// See also <https://cs.opensource.google/go/go/+/refs/tags/go1.19.5:src/encoding/base32/base32.go;l=526-531;drc=8a5845e4e34c046758af3729acf9221b8b6c01ae>
|
||||
#[inline(always)]
|
||||
fn base32_no_padding_decoded_len(n: usize) -> usize {
|
||||
const fn base32_no_padding_decoded_len(n: usize) -> usize {
|
||||
n * 5 / 8
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user