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:
@ -55,7 +55,7 @@ pub(crate) struct ChecksumViewer<'a, DB: Database> {
|
||||
}
|
||||
|
||||
impl<DB: Database> ChecksumViewer<'_, DB> {
|
||||
pub(crate) fn new(tool: &'_ DbTool<DB>) -> ChecksumViewer<'_, DB> {
|
||||
pub(crate) const fn new(tool: &'_ DbTool<DB>) -> ChecksumViewer<'_, DB> {
|
||||
ChecksumViewer { tool, start_key: None, end_key: None, limit: None }
|
||||
}
|
||||
|
||||
|
||||
@ -418,7 +418,7 @@ enum ExtraTableElement<T: Table> {
|
||||
|
||||
impl<T: Table> ExtraTableElement<T> {
|
||||
/// Return the key for the extra element
|
||||
fn key(&self) -> &T::Key {
|
||||
const fn key(&self) -> &T::Key {
|
||||
match self {
|
||||
Self::First { key, .. } => key,
|
||||
Self::Second { key, .. } => key,
|
||||
|
||||
@ -55,7 +55,7 @@ enum Entries<T: Table> {
|
||||
impl<T: Table> Entries<T> {
|
||||
/// Creates new empty [Entries] as [Entries::RawValues] if `raw_values == true` and as
|
||||
/// [Entries::Values] if `raw == false`.
|
||||
fn new_with_raw_values(raw_values: bool) -> Self {
|
||||
const fn new_with_raw_values(raw_values: bool) -> Self {
|
||||
if raw_values {
|
||||
Self::RawValues(Vec::new())
|
||||
} else {
|
||||
@ -85,7 +85,7 @@ impl<T: Table> Entries<T> {
|
||||
|
||||
/// Returns an iterator over keys of the internal [Vec]. For both [Entries::RawValues] and
|
||||
/// [Entries::Values], this iterator will yield [Table::Key].
|
||||
fn iter_keys(&self) -> EntriesKeyIter<'_, T> {
|
||||
const fn iter_keys(&self) -> EntriesKeyIter<'_, T> {
|
||||
EntriesKeyIter { entries: self, index: 0 }
|
||||
}
|
||||
}
|
||||
|
||||
@ -148,6 +148,6 @@ fn min_sigstack_size() -> usize {
|
||||
|
||||
/// Not all OS support hardware where this is needed.
|
||||
#[cfg(not(any(target_os = "linux", target_os = "android")))]
|
||||
fn min_sigstack_size() -> usize {
|
||||
const fn min_sigstack_size() -> usize {
|
||||
libc::MINSIGSTKSZ
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user