mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore(clippy): make clippy happy (#4578)
Co-authored-by: Alexey Shekhirin <a.shekhirin@gmail.com>
This commit is contained in:
@ -47,9 +47,17 @@ pub const fn const_add(a: usize, b: usize) -> usize {
|
||||
a + b
|
||||
}
|
||||
|
||||
/// A trait for types that have a maximum encoded length.
|
||||
///
|
||||
/// # Safety
|
||||
/// Invalid value can cause the encoder to crash.
|
||||
#[doc(hidden)]
|
||||
pub unsafe trait MaxEncodedLen<const LEN: usize>: Encodable {}
|
||||
|
||||
/// A trait for types that have a maximum encoded length.
|
||||
///
|
||||
/// # Safety
|
||||
/// Invalid value can cause the encoder to crash.
|
||||
#[doc(hidden)]
|
||||
pub unsafe trait MaxEncodedLenAssoc: Encodable {
|
||||
const LEN: usize;
|
||||
|
||||
@ -4,10 +4,16 @@ use std::{borrow::Cow, slice};
|
||||
|
||||
/// Implement this to be able to decode data values
|
||||
pub trait TableObject<'tx> {
|
||||
/// Decodes the object from the given bytes.
|
||||
fn decode(data_val: &[u8]) -> Result<Self, Error>
|
||||
where
|
||||
Self: Sized;
|
||||
|
||||
/// Decodes the value directly from the given MDBX_val pointer.
|
||||
///
|
||||
/// # Safety
|
||||
///
|
||||
/// This should only in the context of an MDBX transaction.
|
||||
#[doc(hidden)]
|
||||
unsafe fn decode_val<K: TransactionKind>(
|
||||
_: *const ffi::MDBX_txn,
|
||||
|
||||
Reference in New Issue
Block a user