Skip to content

Commit

Permalink
use derived default
Browse files Browse the repository at this point in the history
  • Loading branch information
nbaztec committed Sep 16, 2023
1 parent b0a5130 commit 3ece8e0
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,15 @@ const CACHE_TYPE_TRANSACTIONS: &str = "transactions";
/// None : Caching is disabled
/// Memory : Caching is provided in-memory and not persisted across runs
/// Disk : Caching is persisted on disk in the provided directory and can be reset
#[derive(Debug, Clone)]
#[derive(Default, Debug, Clone)]
pub enum CacheConfig {
#[default]
None,
Memory,
Disk { dir: String, reset: bool },
}

impl std::default::Default for CacheConfig {
fn default() -> Self {
CacheConfig::None
}
Disk {
dir: String,
reset: bool,
},
}

/// A general purpose cache.
Expand Down

0 comments on commit 3ece8e0

Please sign in to comment.