fud | lilith | research/dhtd/ | geode | tests : Refactor to return match statements

This commit is contained in:
nighthawk24
2024-02-20 15:57:02 +01:00
committed by skoupidi
parent 22c4f2604b
commit c25df52c64
5 changed files with 32 additions and 30 deletions

View File

@@ -59,10 +59,10 @@ impl RequestHandler for RpcSrv {
async fn handle_request(&self, req: JsonRequest) -> JsonResult {
assert!(req.params.is_array());
match req.method.as_str() {
"ping" => return self.pong(req.id, req.params).await,
"kill" => return self.kill(req.id, req.params).await,
_ => return JsonError::new(ErrorCode::MethodNotFound, None, req.id).into(),
return match req.method.as_str() {
"ping" => self.pong(req.id, req.params).await,
"kill" => self.kill(req.id, req.params).await,
_ => JsonError::new(ErrorCode::MethodNotFound, None, req.id).into(),
}
}