mirror of
https://github.com/ivre/masscanned.git
synced 2025-10-02 06:38:21 +00:00
Replace if / else if using a match
This commit is contained in:
parent
5fb3481607
commit
7427d28d52
1 changed files with 8 additions and 9 deletions
|
@ -118,16 +118,15 @@ pub fn repl<'a>(
|
|||
}
|
||||
}
|
||||
/* proto over else (e.g., UDP) */
|
||||
if id == PROTO_HTTP {
|
||||
return http::repl(data, masscanned, client_info);
|
||||
} else if id == PROTO_STUN {
|
||||
return stun::repl(data, masscanned, &mut client_info);
|
||||
} else if id == PROTO_SSH {
|
||||
return ssh::repl(data, masscanned, &mut client_info);
|
||||
} else {
|
||||
debug!("id: {}", id);
|
||||
match id {
|
||||
PROTO_HTTP => http::repl(data, masscanned, client_info),
|
||||
PROTO_STUN => stun::repl(data, masscanned, &mut client_info),
|
||||
PROTO_SSH => ssh::repl(data, masscanned, &mut client_info),
|
||||
_ => {
|
||||
debug!("id: {}", id);
|
||||
None
|
||||
}
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue