diff options
author | Alex Auvolat <alex@adnab.me> | 2023-09-18 12:17:07 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2023-09-18 12:17:07 +0200 |
commit | 0088599f52f38ae9e00fe772a416150813e2470b (patch) | |
tree | 0f1dcec813cba7ae11d6c2f2f2d9b873963d6662 /src/rpc/graph_algo.rs | |
parent | 749b4865d0a26c600fef79ab0456c827faafb9e8 (diff) | |
download | garage-0088599f52f38ae9e00fe772a416150813e2470b.tar.gz garage-0088599f52f38ae9e00fe772a416150813e2470b.zip |
new layout: fix clippy lints
Diffstat (limited to 'src/rpc/graph_algo.rs')
-rw-r--r-- | src/rpc/graph_algo.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/rpc/graph_algo.rs b/src/rpc/graph_algo.rs index 65450d64..0e88efc4 100644 --- a/src/rpc/graph_algo.rs +++ b/src/rpc/graph_algo.rs @@ -189,7 +189,7 @@ impl Graph<FlowEdge> { let mut fifo = VecDeque::new(); fifo.push_back((idsource, 0)); while let Some((id, lvl)) = fifo.pop_front() { - if level[id] == None { + if level[id].is_none() { // it means id has not yet been reached level[id] = Some(lvl); for edge in self.graph[id].iter() { @@ -199,7 +199,7 @@ impl Graph<FlowEdge> { } } } - if level[idsink] == None { + if level[idsink].is_none() { // There is no residual flow break; } @@ -383,7 +383,7 @@ fn cycles_of_1_forest(forest: &[Option<usize>]) -> Vec<Vec<usize>> { for t in 0..forest.len() { let mut id = t; // while we are on a valid undiscovered node - while time_of_discovery[id] == None { + while time_of_discovery[id].is_none() { time_of_discovery[id] = Some(t); if let Some(i) = forest[id] { id = i; @@ -391,7 +391,7 @@ fn cycles_of_1_forest(forest: &[Option<usize>]) -> Vec<Vec<usize>> { break; } } - if forest[id] != None && time_of_discovery[id] == Some(t) { + if forest[id].is_some() && time_of_discovery[id] == Some(t) { // We discovered an id that we explored at this iteration t. // It means we are on a cycle let mut cy = vec![id; 1]; |