Skip to content

Commit

Permalink
quick syntax cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: wadeking98 <[email protected]>
  • Loading branch information
wadeking98 committed Feb 2, 2024
1 parent 19fc142 commit 0224681
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions libindy_vdr/src/ffi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,9 @@ pub extern "C" fn indy_vdr_set_ledger_txn_cache(
) -> ErrorCode {
catch_err! {
debug!("Setting pool ledger transactions cache: capacity={}, expire_offset={}", capacity, expire_offset);
let store = match path_opt.as_opt_str() {
Some("") => OrderedHashMap::new(new_mem_ordered_store()),
Some(path) => OrderedHashMap::new(new_fs_ordered_store(path.into())?),
None => OrderedHashMap::new(new_mem_ordered_store()),
let store = match path_opt.as_opt_str().unwrap_or_default() {
"" => OrderedHashMap::new(new_mem_ordered_store()),
path => OrderedHashMap::new(new_fs_ordered_store(path.into())?),
};

*write_lock!(LEDGER_CACHE_STRATEGY)? = Some(Arc::new(CacheStrategyTTL::new(capacity, expire_offset.into(), Some(store), None)));
Expand Down

0 comments on commit 0224681

Please sign in to comment.