feat: add asref impls (#12257)

This commit is contained in:
Matthias Seitz
2024-11-01 18:08:41 +01:00
committed by GitHub
parent 41c4bab0f7
commit bc69f6348f
2 changed files with 15 additions and 0 deletions

View File

@ -81,6 +81,15 @@ impl<'a, DB> CachedReadsDbMut<'a, DB> {
}
}
impl<DB, T> AsRef<T> for CachedReadsDbMut<'_, DB>
where
DB: AsRef<T>,
{
fn as_ref(&self) -> &T {
self.inner().as_ref()
}
}
impl<DB: DatabaseRef> Database for CachedReadsDbMut<'_, DB> {
type Error = <DB as DatabaseRef>::Error;

View File

@ -79,6 +79,12 @@ impl<DB> StateProviderDatabase<DB> {
}
}
impl<DB> AsRef<DB> for StateProviderDatabase<DB> {
fn as_ref(&self) -> &DB {
self
}
}
impl<DB> Deref for StateProviderDatabase<DB> {
type Target = DB;