chore(clippy): make clippy happy (#4578)

Co-authored-by: Alexey Shekhirin <a.shekhirin@gmail.com>
This commit is contained in:
Matthias Seitz
2023-09-13 14:48:45 +02:00
committed by GitHub
parent c4acd08ff0
commit 48b75e0ad2
2 changed files with 14 additions and 0 deletions

View File

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

View File

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