Commit da5b7323 authored by Ranadeep Biswas's avatar Ranadeep Biswas
Browse files

cargo fmt + clippy

parent 5f23e9c5
......@@ -28,8 +28,8 @@ impl AtomicHistoryPO {
let v: Vec<_> = n_sizes
.iter()
.enumerate()
.filter_map(|(node_i, node_len)| {
if node_len > &0 {
.filter_map(|(node_i, &node_len)| {
if node_len > 0 {
Some((node_i + 1, 0))
} else {
None
......@@ -172,7 +172,7 @@ impl ConstrainedLinearization for PrefixConsistentHistory {
.or_insert_with(Default::default)
.remove(&curr_txn.0));
}
self.active_write.retain(|_, ts| ts.len() > 0);
self.active_write.retain(|_, ts| !ts.is_empty());
}
}
......@@ -288,7 +288,7 @@ impl ConstrainedLinearization for SnapshotIsolationHistory {
.entry(x)
.or_insert_with(Default::default)
.remove(&curr_txn.0));
self.active_write.retain(|_, ts| ts.len() > 0);
self.active_write.retain(|_, ts| !ts.is_empty());
}
self.active_variable = self
......@@ -392,7 +392,7 @@ impl ConstrainedLinearization for SerializableHistory {
.or_insert_with(Default::default)
.remove(curr_txn));
}
self.active_write.retain(|_, ts| ts.len() > 0);
self.active_write.retain(|_, ts| !ts.is_empty());
for &x in curr_txn_info.1.iter() {
let read_by = self
.history
......
pub mod sat;
pub mod algo;
pub mod sat;
pub mod util;
#[derive(Debug)]
......
......@@ -48,10 +48,8 @@ where
fn dfs_util_reach(&self, s: &T, u: &T, reachable: &mut HashSet<T>) -> bool {
if let Some(vs) = self.adj_map.get(u) {
for &v in vs.iter() {
if reachable.insert(v) {
if self.dfs_util_reach(s, &v, reachable) {
return true;
}
if reachable.insert(v) && self.dfs_util_reach(s, &v, reachable) {
return true;
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment