ForkCondition: some small refactors (#10712)

This commit is contained in:
Thomas Coratger
2024-09-05 09:17:29 -07:00
committed by GitHub
parent b0fddef46a
commit 1ec5678081
2 changed files with 5 additions and 4 deletions

View File

@ -68,7 +68,7 @@ impl ChainHardforks {
/// Retrieves [`ForkCondition`] from `fork`. If `fork` is not present, returns
/// [`ForkCondition::Never`].
pub fn fork<H: Hardfork>(&self, fork: H) -> ForkCondition {
self.get(fork).unwrap_or(ForkCondition::Never)
self.get(fork).unwrap_or_default()
}
/// Retrieves [`ForkCondition`] from `fork` if it exists, otherwise `None`.