From 2f5a1acc82dd85218835c4056ee49ef0f05a0be4 Mon Sep 17 00:00:00 2001 From: Richard Zak Date: Fri, 19 Jan 2024 21:47:43 -0500 Subject: [PATCH] chore: satisfy clippy Signed-off-by: Richard Zak --- crates/server/src/tags/query.rs | 6 +++--- crates/server/src/users/get.rs | 6 +++--- crates/server/src/users/head.rs | 6 +++--- crates/server/src/users/put.rs | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/crates/server/src/tags/query.rs b/crates/server/src/tags/query.rs index d8cf8829..f343dc10 100644 --- a/crates/server/src/tags/query.rs +++ b/crates/server/src/tags/query.rs @@ -15,13 +15,13 @@ use mime::APPLICATION_JSON; use tracing::{debug, trace}; pub async fn query( - Extension(ref store): Extension>, - ref cx: RepositoryContext, + Extension(store): Extension>, + cx: RepositoryContext, req: Request, ) -> impl IntoResponse { trace!(target: "app::tags::query", "called for `{cx}`"); - assert_repository_read(store, cx, req) + assert_repository_read(&store, &cx, req) .await .map_err(IntoResponse::into_response) .map(|(repo, _)| repo)? diff --git a/crates/server/src/users/get.rs b/crates/server/src/users/get.rs index 1d76bb1c..13be8047 100644 --- a/crates/server/src/users/get.rs +++ b/crates/server/src/users/get.rs @@ -11,14 +11,14 @@ use axum::Extension; use tracing::{debug, trace}; pub async fn get( - Extension(ref store): Extension>, + Extension(store): Extension>, claims: OidcClaims, - ref cx: UserContext, + cx: UserContext, ) -> impl IntoResponse { trace!(target: "app::users::get", "called for `{cx}`"); let user = claims - .assert_user(store, cx, ScopeContext::User, ScopeLevel::Read) + .assert_user(&store, &cx, ScopeContext::User, ScopeLevel::Read) .await .map_err(IntoResponse::into_response)?; diff --git a/crates/server/src/users/head.rs b/crates/server/src/users/head.rs index f1d27a97..de8dd0e6 100644 --- a/crates/server/src/users/head.rs +++ b/crates/server/src/users/head.rs @@ -11,14 +11,14 @@ use axum::Extension; use tracing::{debug, trace}; pub async fn head( - Extension(ref store): Extension>, + Extension(store): Extension>, claims: OidcClaims, - ref cx: UserContext, + cx: UserContext, ) -> impl IntoResponse { trace!(target: "app::users::head", "called for `{cx}`"); claims - .assert_user(store, cx, ScopeContext::User, ScopeLevel::Read) + .assert_user(&store, &cx, ScopeContext::User, ScopeLevel::Read) .await .map_err(IntoResponse::into_response)? .get_meta() diff --git a/crates/server/src/users/put.rs b/crates/server/src/users/put.rs index 61e7418f..881a0ec0 100644 --- a/crates/server/src/users/put.rs +++ b/crates/server/src/users/put.rs @@ -12,11 +12,11 @@ use axum::{Extension, Json}; use tracing::{debug, trace}; pub async fn put( - Extension(ref store): Extension>, + Extension(store): Extension>, claims: OidcClaims, - ref cx: UserContext, + cx: UserContext, meta: Meta, - Json(ref record): Json, + Json(record): Json, ) -> impl IntoResponse { trace!(target: "app::users::put", "called for `{cx}`"); @@ -29,7 +29,7 @@ pub async fn put( } store - .create_user(cx, meta, record) + .create_user(&cx, meta, &record) .await .map_err(|e| { debug!(target: "app::users::put", "failed for `{cx}`: {:?}", e);