diff --git a/patch-db/Cargo.toml b/patch-db/Cargo.toml index abe2de4..75dc2e4 100644 --- a/patch-db/Cargo.toml +++ b/patch-db/Cargo.toml @@ -19,7 +19,7 @@ trace = ["debug", "tracing-error"] async-trait = "0.1.42" fd-lock-rs = "0.1.3" futures = "0.3.8" -im = "*" +imbl = "1.0.1" json-patch = { path = "../json-patch" } json-ptr = { path = "../json-ptr" } lazy_static = "1.4.0" diff --git a/patch-db/src/locker.rs b/patch-db/src/locker.rs index 394de2d..24a3907 100644 --- a/patch-db/src/locker.rs +++ b/patch-db/src/locker.rs @@ -1,6 +1,6 @@ use std::collections::{BTreeMap, VecDeque}; -use im::{ordset, OrdSet}; +use imbl::{ordset, OrdSet}; use json_ptr::{JsonPointer, SegList}; use tokio::sync::{mpsc, oneshot}; @@ -73,7 +73,9 @@ impl Locker { &mut locks_on_lease, &mut request_queue, ); - hot_seat.map_or((), |a| request_queue.push_front(a)); + if let Some(hot_seat) = hot_seat { + request_queue.push_front(hot_seat); + } } Action::HandleRelease(lock_info) => { // release actual lock @@ -106,7 +108,9 @@ impl Locker { &mut request_queue, ) } - hot_seat.map_or((), |a| request_queue.push_front(a)); + if let Some(hot_seat) = hot_seat { + request_queue.push_front(hot_seat); + } } } Action::HandleCancel(lock_info) => {