From d20e3bdffbcb389579bdae9d8de69a08abdfcbce Mon Sep 17 00:00:00 2001 From: Alex Snaps Date: Wed, 8 Jun 2022 15:34:54 -0400 Subject: [PATCH] No need to convert early --- limitador-server/src/http_api/server.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/limitador-server/src/http_api/server.rs b/limitador-server/src/http_api/server.rs index ae436787..cf5fa072 100644 --- a/limitador-server/src/http_api/server.rs +++ b/limitador-server/src/http_api/server.rs @@ -75,14 +75,8 @@ async fn get_limits( namespace: web::Path, ) -> Result>, ErrorResponse> { let get_limits_result = match data.get_ref().as_ref() { - Limiter::Blocking(limiter) => { - let namespace: Namespace = namespace.into_inner().into(); - limiter.get_limits(namespace) - } - Limiter::Async(limiter) => { - let namespace: Namespace = namespace.into_inner().into(); - limiter.get_limits(namespace).await - } + Limiter::Blocking(limiter) => limiter.get_limits(namespace.into_inner()), + Limiter::Async(limiter) => limiter.get_limits(namespace.into_inner()).await, }; match get_limits_result {