From d1960a8b7488dffe161080714447120fa6f85db1 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 18 Jul 2026 00:48:13 +0900 Subject: refactor(curl-downloader): drop unnecessary Rc wrapping around handles CurlDownloader::auth_helper was never cloned out to another owner, so Rc> only needed the RefCell for interior mutability (all methods take &self). Likewise HttpDownloader::dispatch cloned self.rfs into a local binding it only ever used synchronously (copy/get_contents don't await), so the clone bought nothing. Co-Authored-By: Claude Sonnet 5 --- crates/shirabe/src/util/http/curl_downloader.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'crates/shirabe/src/util/http') diff --git a/crates/shirabe/src/util/http/curl_downloader.rs b/crates/shirabe/src/util/http/curl_downloader.rs index 454836e7..47260a85 100644 --- a/crates/shirabe/src/util/http/curl_downloader.rs +++ b/crates/shirabe/src/util/http/curl_downloader.rs @@ -45,7 +45,7 @@ pub struct CurlDownloader { client: reqwest::Client, io: std::rc::Rc>, config: std::rc::Rc>, - auth_helper: std::rc::Rc>, + auth_helper: std::cell::RefCell, max_redirects: i64, max_retries: i64, } @@ -88,10 +88,7 @@ impl CurlDownloader { // cannot proceed, mirroring PHP aborting when curl is missing. .expect("failed to build reqwest client for CurlDownloader"); - let auth_helper = std::rc::Rc::new(std::cell::RefCell::new(AuthHelper::new( - io.clone(), - config.clone(), - ))); + let auth_helper = std::cell::RefCell::new(AuthHelper::new(io.clone(), config.clone())); Self { client, -- cgit v1.3.1