mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-01-08 22:28:12 -05:00
fud | lilith | research/dhtd/ | geode | tests : Refactor to return match statements
This commit is contained in:
@@ -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(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user