diff --git a/api/src/analysis.rs b/api/src/analysis.rs index 2b43f6bb..fd5bfa9c 100644 --- a/api/src/analysis.rs +++ b/api/src/analysis.rs @@ -454,7 +454,7 @@ struct SyncLoader<'a> { files: &'a HashMap>, } -impl<'a> SyncLoader<'a> { +impl SyncLoader<'_> { fn load_sync( &self, specifier: &ModuleSpecifier, @@ -484,7 +484,7 @@ impl<'a> SyncLoader<'a> { } } -impl<'a> deno_graph::source::Loader for SyncLoader<'a> { +impl deno_graph::source::Loader for SyncLoader<'_> { fn load( &self, specifier: &ModuleSpecifier, @@ -628,7 +628,7 @@ struct GcsLoader<'a> { version: &'a Version, } -impl<'a> GcsLoader<'a> { +impl GcsLoader<'_> { fn load_inner( &self, specifier: &ModuleSpecifier, @@ -669,7 +669,7 @@ impl<'a> GcsLoader<'a> { } } -impl<'a> deno_graph::source::Loader for GcsLoader<'a> { +impl deno_graph::source::Loader for GcsLoader<'_> { fn load( &self, specifier: &ModuleSpecifier, diff --git a/api/src/api/admin.rs b/api/src/api/admin.rs index b6ba0a01..61d766bd 100644 --- a/api/src/api/admin.rs +++ b/api/src/api/admin.rs @@ -114,7 +114,7 @@ pub async fn update_user(mut req: Request) -> ApiResult { iam.check_admin_access()?; let user_id = req.param_uuid("user_id")?; - Span::current().record("user_id", &field::display(&user_id)); + Span::current().record("user_id", field::display(&user_id)); let ApiAdminUpdateUserRequest { is_staff, is_blocked, @@ -172,7 +172,7 @@ pub async fn patch_scopes(mut req: Request) -> ApiResult { iam.check_admin_access()?; let scope = req.param_scope()?; - Span::current().record("scope", &field::display(&scope)); + Span::current().record("scope", field::display(&scope)); let ApiAdminUpdateScopeRequest { package_limit, @@ -214,8 +214,8 @@ pub async fn assign_scope(mut req: Request) -> ApiResult { iam.check_admin_access()?; let ApiAssignScopeRequest { scope, user_id } = decode_json(&mut req).await?; - Span::current().record("scope", &field::display(&scope)); - Span::current().record("user_id", &field::display(&user_id)); + Span::current().record("scope", field::display(&scope)); + Span::current().record("user_id", field::display(&user_id)); let db = req.data::().unwrap(); @@ -268,7 +268,7 @@ pub async fn requeue_publishing_tasks(req: Request) -> ApiResult<()> { let publishing_task_id = req.param_uuid("publishing_task")?; Span::current() - .record("publishing_task", &field::display(&publishing_task_id)); + .record("publishing_task", field::display(&publishing_task_id)); let db = req.data::().unwrap().clone(); let task = db diff --git a/api/src/api/authorization.rs b/api/src/api/authorization.rs index b2a3b627..0c29510f 100644 --- a/api/src/api/authorization.rs +++ b/api/src/api/authorization.rs @@ -302,7 +302,7 @@ mod tests { async fn details(t: &mut TestSetup, code: &str) -> Response { t.http() - .get(&format!("/api/authorizations/details/{}", code)) + .get(format!("/api/authorizations/details/{}", code)) .call() .await .unwrap() @@ -335,7 +335,7 @@ mod tests { let mut resp = t .http() - .post(&format!("/api/authorizations/approve/{}", auth.code)) + .post(format!("/api/authorizations/approve/{}", auth.code)) .call() .await .unwrap(); @@ -399,7 +399,7 @@ mod tests { let mut resp = t .http() - .post(&format!("/api/authorizations/approve/{}", auth.code)) + .post(format!("/api/authorizations/approve/{}", auth.code)) .call() .await .unwrap(); @@ -454,7 +454,7 @@ mod tests { let mut resp = t .http() - .post(&format!("/api/authorizations/deny/{}", auth.code)) + .post(format!("/api/authorizations/deny/{}", auth.code)) .call() .await .unwrap(); diff --git a/api/src/api/package.rs b/api/src/api/package.rs index 8e857fb0..008b5069 100644 --- a/api/src/api/package.rs +++ b/api/src/api/package.rs @@ -223,7 +223,7 @@ pub async fn list_handler( req: Request, ) -> ApiResult> { let scope = req.param_scope()?; - Span::current().record("scope", &field::display(&scope)); + Span::current().record("scope", field::display(&scope)); let (start, limit) = pagination(&req); @@ -250,12 +250,12 @@ pub async fn list_handler( )] pub async fn create_handler(mut req: Request) -> ApiResult { let scope = req.param_scope()?; - Span::current().record("scope", &field::display(&scope)); + Span::current().record("scope", field::display(&scope)); let ApiCreatePackageRequest { package: package_name, } = decode_json(&mut req).await?; - Span::current().record("package", &field::display(&package_name)); + Span::current().record("package", field::display(&package_name)); let iam = req.iam(); iam.check_scope_write_access(&scope).await?; @@ -298,8 +298,8 @@ pub async fn get_handler(req: Request) -> ApiResult { let scope = req.param_scope()?; let package = req.param_package()?; - Span::current().record("scope", &field::display(&scope)); - Span::current().record("package", &field::display(&package)); + Span::current().record("scope", field::display(&scope)); + Span::current().record("package", field::display(&package)); let db = req.data::().unwrap(); let package = db @@ -540,8 +540,8 @@ pub async fn list_versions_handler( let scope = req.param_scope()?; let package = req.param_package()?; - Span::current().record("scope", &field::display(&scope)); - Span::current().record("package", &field::display(&package)); + Span::current().record("scope", field::display(&scope)); + Span::current().record("package", field::display(&package)); let db = req.data::().unwrap(); @@ -608,9 +608,9 @@ pub async fn get_version_handler( let scope = req.param_scope()?; let package = req.param_package()?; let version = req.param_version_or_latest()?; - Span::current().record("scope", &field::display(&scope)); - Span::current().record("package", &field::display(&package)); - Span::current().record("version", &field::display(&version)); + Span::current().record("scope", field::display(&scope)); + Span::current().record("package", field::display(&package)); + Span::current().record("version", field::display(&version)); let db = req.data::().unwrap(); let _ = db @@ -645,9 +645,9 @@ pub async fn version_publish_handler( let package_scope = req.param_scope()?; let package_name = req.param_package()?; let package_version = req.param_version()?; - Span::current().record("scope", &field::display(&package_scope)); - Span::current().record("package", &field::display(&package_name)); - Span::current().record("version", &field::display(&package_version)); + Span::current().record("scope", field::display(&package_scope)); + Span::current().record("package", field::display(&package_name)); + Span::current().record("version", field::display(&package_version)); let config_file = PackagePath::try_from(&**req.query("config").ok_or_else(|| { let msg = "Missing query parameter 'config'".into(); @@ -813,9 +813,9 @@ pub async fn version_provenance_statements_handler( let package = req.param_package()?; let version = req.param_version()?; - Span::current().record("scope", &field::display(&scope)); - Span::current().record("package", &field::display(&package)); - Span::current().record("version", &field::display(&version)); + Span::current().record("scope", field::display(&scope)); + Span::current().record("package", field::display(&package)); + Span::current().record("version", field::display(&version)); let body: ApiProvenanceStatementRequest = decode_json(&mut req).await?; @@ -835,7 +835,7 @@ pub async fn version_provenance_statements_handler( let (package, _, meta) = db .get_package(&scope, &package) .await? - .ok_or_else(|| ApiError::InternalServerError)?; + .ok_or(ApiError::InternalServerError)?; orama_client.upsert_package(&package, &meta); } @@ -859,9 +859,9 @@ pub async fn version_update_handler( let scope = req.param_scope()?; let package = req.param_package()?; let version = req.param_version()?; - Span::current().record("scope", &field::display(&scope)); - Span::current().record("package", &field::display(&package)); - Span::current().record("version", &field::display(&version)); + Span::current().record("scope", field::display(&scope)); + Span::current().record("package", field::display(&package)); + Span::current().record("version", field::display(&version)); // WARNING: if an additional option gets added, then yanked time rendering needs to be changed in package/versions.tsx let body: ApiUpdatePackageVersionRequest = decode_json(&mut req).await?; @@ -933,17 +933,17 @@ pub async fn get_docs_handler( let scope = req.param_scope()?; let package_name = req.param_package()?; let version_or_latest = req.param_version_or_latest()?; - Span::current().record("scope", &field::display(&scope)); - Span::current().record("package", &field::display(&package_name)); - Span::current().record("version", &field::display(&version_or_latest)); + Span::current().record("scope", field::display(&scope)); + Span::current().record("package", field::display(&package_name)); + Span::current().record("version", field::display(&version_or_latest)); let all_symbols = req.query("all_symbols").is_some(); - Span::current().record("all_symbols", &field::display(&all_symbols)); + Span::current().record("all_symbols", field::display(&all_symbols)); let entrypoint = req.query("entrypoint").and_then(|s| match s.as_str() { "" => None, s => Some(s), }); Span::current() - .record("entrypoint", &field::display(&entrypoint.unwrap_or(""))); + .record("entrypoint", field::display(&entrypoint.unwrap_or(""))); let symbol = req .query("symbol") @@ -953,7 +953,7 @@ pub async fn get_docs_handler( }) .transpose()?; Span::current() - .record("symbol", &field::display(&symbol.as_deref().unwrap_or(""))); + .record("symbol", field::display(&symbol.as_deref().unwrap_or(""))); if all_symbols && (entrypoint.is_some() || symbol.is_some()) { return Err(ApiError::MalformedRequest { @@ -1087,9 +1087,9 @@ pub async fn get_docs_search_handler( let scope = req.param_scope()?; let package_name = req.param_package()?; let version_or_latest = req.param_version_or_latest()?; - Span::current().record("scope", &field::display(&scope)); - Span::current().record("package", &field::display(&package_name)); - Span::current().record("version", &field::display(&version_or_latest)); + Span::current().record("scope", field::display(&scope)); + Span::current().record("package", field::display(&package_name)); + Span::current().record("version", field::display(&version_or_latest)); let db = req.data::().unwrap(); let buckets = req.data::().unwrap(); @@ -1158,9 +1158,9 @@ pub async fn get_docs_search_html_handler( let scope = req.param_scope()?; let package_name = req.param_package()?; let version_or_latest = req.param_version_or_latest()?; - Span::current().record("scope", &field::display(&scope)); - Span::current().record("package", &field::display(&package_name)); - Span::current().record("version", &field::display(&version_or_latest)); + Span::current().record("scope", field::display(&scope)); + Span::current().record("package", field::display(&package_name)); + Span::current().record("version", field::display(&version_or_latest)); let db = req.data::().unwrap(); let buckets = req.data::().unwrap(); @@ -1240,10 +1240,10 @@ pub async fn get_source_handler( let version_or_latest = req.param_version_or_latest()?; let path = req.query("path").cloned().unwrap_or("/".to_string()); - Span::current().record("scope", &field::display(&scope)); - Span::current().record("package", &field::display(&package)); - Span::current().record("version", &field::display(&version_or_latest)); - Span::current().record("path", &field::display(&path)); + Span::current().record("scope", field::display(&scope)); + Span::current().record("package", field::display(&package)); + Span::current().record("version", field::display(&version_or_latest)); + Span::current().record("path", field::display(&path)); let db = req.data::().unwrap(); let buckets = req.data::().unwrap(); @@ -1397,8 +1397,8 @@ pub async fn list_dependents_handler( ) -> ApiResult> { let scope = req.param_scope()?; let package = req.param_package()?; - Span::current().record("scope", &field::display(&scope)); - Span::current().record("package", &field::display(&package)); + Span::current().record("scope", field::display(&scope)); + Span::current().record("package", field::display(&package)); let (start, limit) = pagination(&req); let versions_per_package_limit = req @@ -1440,8 +1440,8 @@ pub async fn get_downloads_handler( ) -> ApiResult { let scope = req.param_scope()?; let package = req.param_package()?; - Span::current().record("scope", &field::display(&scope)); - Span::current().record("package", &field::display(&package)); + Span::current().record("scope", field::display(&scope)); + Span::current().record("package", field::display(&package)); let db = req.data::().unwrap(); db.get_package(&scope, &package) @@ -1499,9 +1499,9 @@ pub async fn list_dependencies_handler( let scope = req.param_scope()?; let package = req.param_package()?; let version = req.param_version()?; - Span::current().record("scope", &field::display(&scope)); - Span::current().record("package", &field::display(&package)); - Span::current().record("version", &field::display(&version)); + Span::current().record("scope", field::display(&scope)); + Span::current().record("package", field::display(&package)); + Span::current().record("version", field::display(&version)); let db = req.data::().unwrap(); @@ -1531,8 +1531,8 @@ pub async fn list_publishing_tasks_handler( ) -> ApiResult> { let scope = req.param_scope()?; let package = req.param_package()?; - Span::current().record("scope", &field::display(&scope)); - Span::current().record("package", &field::display(&package)); + Span::current().record("scope", field::display(&scope)); + Span::current().record("package", field::display(&package)); let db = req.data::().unwrap(); @@ -1562,8 +1562,8 @@ pub async fn get_score_handler( ) -> ApiResult { let scope = req.param_scope()?; let package = req.param_package()?; - Span::current().record("scope", &field::display(&scope)); - Span::current().record("package", &field::display(&package)); + Span::current().record("scope", field::display(&scope)); + Span::current().record("package", field::display(&package)); let db = req.data::().unwrap(); let (pkg, _, meta) = db @@ -3359,7 +3359,7 @@ ggHohNAjhbzDaY2iBW/m3NC5dehGUP4T2GBo/cwGhg== assert_eq!(tasks.len(), 1); t.http() - .delete(&format!( + .delete(format!( "/api/scopes/{}/packages/{}", scope_name, package_name )) diff --git a/api/src/api/publishing_task.rs b/api/src/api/publishing_task.rs index 84dfbbd6..11ff68fc 100644 --- a/api/src/api/publishing_task.rs +++ b/api/src/api/publishing_task.rs @@ -31,7 +31,7 @@ pub fn publishing_task_router() -> Router { pub async fn get_handler(req: Request) -> ApiResult { let publishing_task_id = req.param_uuid("publishing_task_id")?; Span::current() - .record("publishing_task_id", &field::display(&publishing_task_id)); + .record("publishing_task_id", field::display(&publishing_task_id)); let db = req.data::().unwrap(); diff --git a/api/src/api/scope.rs b/api/src/api/scope.rs index bdb40ce3..89ac6a2b 100644 --- a/api/src/api/scope.rs +++ b/api/src/api/scope.rs @@ -64,7 +64,7 @@ static RESERVED_SCOPES: OnceLock> = #[instrument(name = "POST /api/scopes", skip(req), err, fields(scope))] async fn create_handler(mut req: Request) -> ApiResult { let ApiCreateScopeRequest { scope } = decode_json(&mut req).await?; - Span::current().record("scope", &field::display(&scope)); + Span::current().record("scope", field::display(&scope)); let db = req.data::().unwrap(); @@ -104,7 +104,7 @@ async fn create_handler(mut req: Request) -> ApiResult { #[instrument(name = "GET /api/scopes/:scope", skip(req), err, fields(scope))] async fn get_handler(req: Request) -> ApiResult { let scope_name = req.param_scope()?; - Span::current().record("scope", &field::display(&scope_name)); + Span::current().record("scope", field::display(&scope_name)); let db = req.data::().unwrap(); let scope = db @@ -130,7 +130,7 @@ async fn update_handler( mut req: Request, ) -> ApiResult { let scope = req.param_scope()?; - Span::current().record("scope", &field::display(&scope)); + Span::current().record("scope", field::display(&scope)); let update_req: ApiUpdateScopeRequest = decode_json(&mut req).await?; @@ -202,7 +202,7 @@ async fn list_members_handler( req: Request, ) -> ApiResult> { let scope = req.param_scope()?; - Span::current().record("scope", &field::display(&scope)); + Span::current().record("scope", field::display(&scope)); let db = req.data::().unwrap(); let scope_members = db.list_scope_members(&scope).await?; @@ -228,7 +228,7 @@ async fn invite_member_handler( mut req: Request, ) -> ApiResult { let scope = req.param_scope()?; - Span::current().record("scope", &field::display(&scope)); + Span::current().record("scope", field::display(&scope)); let invite = decode_json::(&mut req).await?; @@ -313,8 +313,8 @@ async fn invite_member_handler( async fn get_member_handler(req: Request) -> ApiResult { let scope = req.param_scope()?; let member_id = req.param_uuid("member")?; - Span::current().record("scope", &field::display(&scope)); - Span::current().record("member", &field::display(&member_id)); + Span::current().record("scope", field::display(&scope)); + Span::current().record("member", field::display(&member_id)); let db = req.data::().unwrap(); @@ -341,8 +341,8 @@ async fn update_member_handler( ) -> ApiResult { let scope = req.param_scope()?; let member_id = req.param_uuid("member")?; - Span::current().record("scope", &field::display(&scope)); - Span::current().record("member", &field::display(&member_id)); + Span::current().record("scope", field::display(&scope)); + Span::current().record("member", field::display(&member_id)); let ApiUpdateScopeMemberRequest { is_admin } = decode_json(&mut req).await?; @@ -389,8 +389,8 @@ pub async fn delete_member_handler( ) -> ApiResult> { let scope = req.param_scope()?; let member_id = req.param_uuid("member")?; - Span::current().record("scope", &field::display(&scope)); - Span::current().record("member", &field::display(&member_id)); + Span::current().record("scope", field::display(&scope)); + Span::current().record("member", field::display(&member_id)); let db = req.data::().unwrap(); @@ -432,7 +432,7 @@ pub async fn list_invites_handler( req: Request, ) -> ApiResult> { let scope = req.param_scope()?; - Span::current().record("scope", &field::display(&scope)); + Span::current().record("scope", field::display(&scope)); let db = req.data::().unwrap(); @@ -462,8 +462,8 @@ pub async fn delete_invite_handler( ) -> ApiResult> { let scope = req.param_scope()?; let user_id = req.param_uuid("user_id")?; - Span::current().record("scope", &field::display(&scope)); - Span::current().record("user_id", &field::display(&user_id)); + Span::current().record("scope", field::display(&scope)); + Span::current().record("user_id", field::display(&user_id)); let db = req.data::().unwrap(); diff --git a/api/src/api/self_user.rs b/api/src/api/self_user.rs index 633d1464..c30d6115 100644 --- a/api/src/api/self_user.rs +++ b/api/src/api/self_user.rs @@ -82,7 +82,7 @@ pub async fn get_member_handler( req: Request, ) -> ApiResult { let scope = req.param_scope()?; - Span::current().record("scope", &field::display(&scope)); + Span::current().record("scope", field::display(&scope)); let iam = req.iam(); let current_user = iam.check_current_user_access()?; @@ -126,7 +126,7 @@ pub async fn accept_invite_handler( req: Request, ) -> ApiResult { let scope = req.param_scope()?; - Span::current().record("scope", &field::display(&scope)); + Span::current().record("scope", field::display(&scope)); let iam = req.iam(); let current_user = iam.check_current_user_access()?.to_owned(); @@ -151,7 +151,7 @@ pub async fn decline_invite_handler( req: Request, ) -> ApiResult> { let scope = req.param_scope()?; - Span::current().record("scope", &field::display(&scope)); + Span::current().record("scope", field::display(&scope)); let iam = req.iam(); let current_user = iam.check_current_user_access()?; @@ -423,7 +423,7 @@ mod tests { .await; t.http() - .delete(&format!("/api/user/tokens/{}", token.id)) + .delete(format!("/api/user/tokens/{}", token.id)) .call() .await .unwrap() @@ -448,7 +448,7 @@ mod tests { // can't delete the token again t.http() - .delete(&format!("/api/user/tokens/{}", token.id)) + .delete(format!("/api/user/tokens/{}", token.id)) .call() .await .unwrap() diff --git a/api/src/api/users.rs b/api/src/api/users.rs index 9947b49f..975cfb4a 100644 --- a/api/src/api/users.rs +++ b/api/src/api/users.rs @@ -27,7 +27,7 @@ pub fn users_router() -> Router { #[instrument(name = "GET /api/users/:id", skip(req), err, fields(id))] pub async fn get_handler(req: Request) -> ApiResult { let id = req.param_uuid("id")?; - Span::current().record("id", &field::display(id)); + Span::current().record("id", field::display(id)); let db = req.data::().unwrap(); let user = db @@ -43,7 +43,7 @@ pub async fn get_scopes_handler( req: Request, ) -> ApiResult> { let id = req.param_uuid("id")?; - Span::current().record("id", &field::display(id)); + Span::current().record("id", field::display(id)); let db = req.data::().unwrap(); db.get_user_public(id) diff --git a/api/src/docs.rs b/api/src/docs.rs index 1b3e0f58..ec64d461 100644 --- a/api/src/docs.rs +++ b/api/src/docs.rs @@ -102,7 +102,7 @@ lazy_static::lazy_static! { struct AmmoniaRelativeUrlEvaluator(); -impl<'b> ammonia::UrlRelativeEvaluate<'b> for AmmoniaRelativeUrlEvaluator { +impl ammonia::UrlRelativeEvaluate<'_> for AmmoniaRelativeUrlEvaluator { fn evaluate<'a>(&self, url: &'a str) -> Option> { URL_REWRITER.with(|url_rewriter| { let rewriter = url_rewriter.borrow(); @@ -1171,6 +1171,7 @@ impl deno_doc::html::UsageComposer for DocUsageComposer { false } + #[allow(clippy::nonminimal_bool)] fn compose( &self, current_resolve: UrlResolveKind, diff --git a/api/src/gcp.rs b/api/src/gcp.rs index c4415b68..7dffbbd9 100644 --- a/api/src/gcp.rs +++ b/api/src/gcp.rs @@ -587,7 +587,7 @@ impl FakeGcsTester { println!("starting fake gcs server: {}", p); let mut proc = std::process::Command::new(p) - .arg(&format!("-port={}", self.port)) + .arg(format!("-port={}", self.port)) .arg("-scheme=http") .arg("-backend=memory") .process_group(0) diff --git a/api/src/npm/import_transform.rs b/api/src/npm/import_transform.rs index 64f65c5a..1669b1c4 100644 --- a/api/src/npm/import_transform.rs +++ b/api/src/npm/import_transform.rs @@ -20,7 +20,7 @@ pub struct ImportRewriteTransformer<'a> { pub kind: RewriteKind, } -impl<'a> VisitMut for ImportRewriteTransformer<'a> { +impl VisitMut for ImportRewriteTransformer<'_> { fn visit_mut_import_decl(&mut self, node: &mut ImportDecl) { node.visit_mut_children_with(self); diff --git a/api/src/npm/specifiers.rs b/api/src/npm/specifiers.rs index 5a28ef3d..c1efb727 100644 --- a/api/src/npm/specifiers.rs +++ b/api/src/npm/specifiers.rs @@ -27,7 +27,7 @@ pub struct SpecifierRewriter<'a> { pub dependencies: &'a IndexMap, } -impl<'a> SpecifierRewriter<'a> { +impl SpecifierRewriter<'_> { pub fn rewrite(&self, specifier: &str, kind: RewriteKind) -> Option { let source_text_specifier = specifier; let dep = self.dependencies.get(specifier)?; diff --git a/api/src/publish.rs b/api/src/publish.rs index 98c6cffb..9971ba4b 100644 --- a/api/src/publish.rs +++ b/api/src/publish.rs @@ -142,7 +142,7 @@ pub async fn publish_task( &publishing_task.package_name, ) .await? - .ok_or_else(|| ApiError::InternalServerError)?; + .ok_or(ApiError::InternalServerError)?; orama_client.upsert_package(&package, &meta); } return Ok(()); diff --git a/api/src/tasks.rs b/api/src/tasks.rs index 2438164d..c6c83864 100644 --- a/api/src/tasks.rs +++ b/api/src/tasks.rs @@ -107,7 +107,7 @@ pub async fn npm_tarball_build_handler( let version = db .get_package_version(&job.scope, &job.name, &job.version) .await? - .ok_or_else(|| ApiError::PackageVersionNotFound)?; + .ok_or(ApiError::PackageVersionNotFound)?; let dependencies = db .list_package_version_dependencies(&job.scope, &job.name, &job.version) .await?; @@ -211,10 +211,7 @@ pub async fn npm_tarball_enqueue_handler(req: Request) -> ApiResult<()> { let db = req.data::().unwrap().clone(); let queue = req.data::().unwrap(); - let queue = queue - .0 - .as_ref() - .ok_or_else(|| ApiError::InternalServerError)?; + let queue = queue.0.as_ref().ok_or(ApiError::InternalServerError)?; let missing_tarballs = db .list_missing_npm_tarballs(NPM_TARBALL_REVISION as i32) diff --git a/api/src/util.rs b/api/src/util.rs index 2c5522c6..228b7675 100644 --- a/api/src/util.rs +++ b/api/src/util.rs @@ -156,7 +156,7 @@ pub async fn auth_middleware(req: Request) -> ApiResult> { let iam_info = match token { Some((AuthorizationToken::Bearer(token), sudo)) => { - span.record("token.kind", &field::display("bearer")); + span.record("token.kind", field::display("bearer")); if let Some(token) = db.get_token_by_hash(&crate::token::hash(token)).await? { @@ -167,7 +167,7 @@ pub async fn auth_middleware(req: Request) -> ApiResult> { } let user = db.get_user(token.user_id).await?.unwrap(); - span.record("user.id", &field::display(user.id)); + span.record("user.id", field::display(user.id)); if user.is_blocked { return Err(ApiError::Blocked); @@ -179,10 +179,10 @@ pub async fn auth_middleware(req: Request) -> ApiResult> { } } Some((AuthorizationToken::GithubOIDC(token), _)) => { - span.record("token.kind", &field::display("githuboidc")); + span.record("token.kind", field::display("githuboidc")); let claims = verify_oidc_token(token).await?; - span.record("repo.id", &field::display(claims.repository_id)); + span.record("repo.id", field::display(claims.repository_id)); let aud: GithubOidcTokenAud = serde_json::from_str(&claims.aud) .map_err(|err| ApiError::InvalidOidcToken { @@ -191,7 +191,7 @@ pub async fn auth_middleware(req: Request) -> ApiResult> { let user = db.get_user_by_github_id(claims.actor_id).await?; if let Some(user) = &user { - span.record("user.id", &field::display(user.id)); + span.record("user.id", field::display(user.id)); } IamInfo::from((claims.repository_id, aud, user)) @@ -659,7 +659,7 @@ pub mod test { auth: Option<&'t str>, } - impl<'s, 't> TestHttpClient<'s, 't> { + impl<'s> TestHttpClient<'s, '_> { pub fn get>(&'s mut self, uri: U) -> TestHttpCall<'s> { TestHttpCall::new( self.service,