Skip to content

Commit

Permalink
#79 match
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Jan 14, 2023
1 parent d3303b0 commit 445ec82
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/find.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,18 +169,19 @@ impl Sodg {
continue;
};
trace!("#find(ν{v1}, {loc}): {indent}calling relay(ν{v}, {k})...");
let redirect = relay.re(v, &k);
let fault = if let Ok(re) = redirect {
if let Ok(to) = self.find_with_indent(v, re.as_str(), relay, depth + 1) {
trace!("#find(ν{v1}, {loc}): {indent}ν{v}.{k} relayed to ν{to} (re: {re})");
v = to;
continue;
let fault = match relay.re(v, &k) {
Ok(re) => {
if let Ok(to) = self.find_with_indent(v, re.as_str(), relay, depth + 1) {
trace!("#find(ν{v1}, {loc}): {indent}ν{v}.{k} relayed to ν{to} (re: {re})");
v = to;
continue;
}
format!("re to '{re}' didn't help")
}
Err(err) => {
trace!("#find(ν{v1}, {loc}): !{}", err);
format!("error: {}", err)
}
format!("re to '{re}' didn't help")
} else {
let msg = redirect.err().unwrap();
trace!("#find(ν{v1}, {loc}): !{}", msg);
format!("error: {}", msg)
};
let others: Vec<String> = self
.vertices
Expand Down

0 comments on commit 445ec82

Please sign in to comment.