forked from ROMEO/nexosim
auto-fix clipp::manual_map|option_map_unit_fn
This commit is contained in:
parent
b9eea5f325
commit
b77a4eaa5f
@ -173,7 +173,9 @@ mod tests {
|
|||||||
}
|
}
|
||||||
impl<F: FnOnce()> Drop for RunOnDrop<F> {
|
impl<F: FnOnce()> Drop for RunOnDrop<F> {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
self.drop_fn.take().map(|f| f());
|
if let Some(f) = self.drop_fn.take() {
|
||||||
|
f()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -649,14 +649,12 @@ mod tests {
|
|||||||
let delete_marked_fn =
|
let delete_marked_fn =
|
||||||
|queue: &mut IndexedPriorityQueue<u64, u64>,
|
|queue: &mut IndexedPriorityQueue<u64, u64>,
|
||||||
shadow_queue: &mut BTreeMap<(u64, usize), u64>| {
|
shadow_queue: &mut BTreeMap<(u64, usize), u64>| {
|
||||||
let success = match marked.take() {
|
let success = marked
|
||||||
Some(delete_key) => Some(queue.extract(delete_key).is_some()),
|
.take()
|
||||||
None => None,
|
.map(|delete_key| queue.extract(delete_key).is_some());
|
||||||
};
|
let shadow_success = shadow_marked
|
||||||
let shadow_success = match shadow_marked.take() {
|
.take()
|
||||||
Some(delete_key) => Some(shadow_queue.remove(&delete_key).is_some()),
|
.map(|delete_key| shadow_queue.remove(&delete_key).is_some());
|
||||||
None => None,
|
|
||||||
};
|
|
||||||
assert_eq!(success, shadow_success);
|
assert_eq!(success, shadow_success);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user