Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
somtochiama committed Sep 18, 2024
1 parent cb45814 commit b71de43
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions crates/corro-admin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -532,12 +532,10 @@ async fn handle_conn(
send_success(&mut stream).await;
}
Command::Subs(SubsCommand::Info { hash, id }) => {
let matcher_handle = {
if let Some(hash) = hash {
agent.subs_manager().get_by_hash(&hash)
} else if let Some(id) = id {
agent.subs_manager().get(&id)
} else {
let matcher_handle = match (hash, id) {
(Some(hash), _) => agent.subs_manager().get_by_hash(&hash),
(None, Some(id)) => agent.subs_manager().get(&id),
(None, None) => {
send_error(&mut stream, "specify hash or id for subscription").await;
continue;
}
Expand Down

0 comments on commit b71de43

Please sign in to comment.