Skip to content

Commit

Permalink
No need to convert early
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsnaps committed Jun 8, 2022
1 parent 01ca3da commit d20e3bd
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions limitador-server/src/http_api/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,8 @@ async fn get_limits(
namespace: web::Path<String>,
) -> Result<web::Json<Vec<Limit>>, 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 {
Expand Down

0 comments on commit d20e3bd

Please sign in to comment.