From ec74669c5119ee799b99139fd23d8328577ea7c1 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Fri, 10 Jan 2025 11:24:10 +0100 Subject: [PATCH] clippy --- crates/api_common/src/claims.rs | 17 +++-------------- crates/routes/src/images/upload.rs | 2 +- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/crates/api_common/src/claims.rs b/crates/api_common/src/claims.rs index 759673f4b..5063ea8fe 100644 --- a/crates/api_common/src/claims.rs +++ b/crates/api_common/src/claims.rs @@ -78,29 +78,18 @@ mod tests { instance::Instance, local_user::{LocalUser, LocalUserInsertForm}, person::{Person, PersonInsertForm}, - secret::Secret, }, traits::Crud, - utils::build_db_pool_for_tests, }; - use lemmy_utils::{error::LemmyResult, rate_limit::RateLimitCell}; + use lemmy_utils::error::LemmyResult; use pretty_assertions::assert_eq; - use reqwest::Client; - use reqwest_middleware::ClientBuilder; use serial_test::serial; #[tokio::test] #[serial] async fn test_should_not_validate_user_token_after_password_change() -> LemmyResult<()> { - let pool_ = build_db_pool_for_tests(); - let pool = &mut (&pool_).into(); - let secret = Secret::init(pool).await?; - let context = LemmyContext::create( - pool_.clone(), - ClientBuilder::new(Client::default()).build(), - secret, - RateLimitCell::with_test_config(), - ); + let context = LemmyContext::init_test_context().await; + let pool = &mut context.pool(); let inserted_instance = Instance::read_or_create(pool, "my_domain.tld".to_string()).await?; diff --git a/crates/routes/src/images/upload.rs b/crates/routes/src/images/upload.rs index 8f77b5a7a..50660419b 100644 --- a/crates/routes/src/images/upload.rs +++ b/crates/routes/src/images/upload.rs @@ -176,7 +176,7 @@ pub async fn do_upload_image( let pictrs = context.settings().pictrs()?; let image_url = format!("{}image", pictrs.url); - let mut client_req = adapt_request(&req, image_url, &context); + let mut client_req = adapt_request(&req, image_url, context); client_req = match upload_type { Avatar => {