mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-30 03:01:58 -04:00
chore: reduce size of common types (#5304)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/// Result alias for [`RethError`]
|
||||
/// Result alias for [`RethError`].
|
||||
pub type RethResult<T> = Result<T, RethError>;
|
||||
|
||||
/// Core error variants possible when interacting with the blockchain
|
||||
/// Core error variants possible when interacting with the blockchain.
|
||||
#[derive(Debug, thiserror::Error, Clone, PartialEq, Eq)]
|
||||
#[allow(missing_docs)]
|
||||
pub enum RethError {
|
||||
@@ -38,3 +38,15 @@ impl From<reth_nippy_jar::NippyJarError> for RethError {
|
||||
RethError::Custom(err.to_string())
|
||||
}
|
||||
}
|
||||
|
||||
// We don't want these types to be too large because they're used in a lot of places.
|
||||
const _SIZE_ASSERTIONS: () = {
|
||||
// Main error.
|
||||
let _: [(); 64] = [(); std::mem::size_of::<RethError>()];
|
||||
|
||||
// Biggest variant.
|
||||
let _: [(); 64] = [(); std::mem::size_of::<crate::provider::ProviderError>()];
|
||||
|
||||
// Other common types.
|
||||
let _: [(); 16] = [(); std::mem::size_of::<crate::db::DatabaseError>()];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user