diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-28 17:45:06 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-28 17:45:26 +0900 |
| commit | 53f1fb395f33e0fb8db9aebd09ea9082f650f9f1 (patch) | |
| tree | f9e8bf0e9d4b1e98cce383574fb6a13b684fff08 /crates/shirabe/src/util/http | |
| parent | 212f5cd75b1403ee75ffa44d7ebdb181174340c0 (diff) | |
| download | php-shirabe-53f1fb395f33e0fb8db9aebd09ea9082f650f9f1.tar.gz php-shirabe-53f1fb395f33e0fb8db9aebd09ea9082f650f9f1.tar.zst php-shirabe-53f1fb395f33e0fb8db9aebd09ea9082f650f9f1.zip | |
refactor: add linter
Diffstat (limited to 'crates/shirabe/src/util/http')
| -rw-r--r-- | crates/shirabe/src/util/http/curl_downloader.rs | 15 | ||||
| -rw-r--r-- | crates/shirabe/src/util/http/curl_response.rs | 3 | ||||
| -rw-r--r-- | crates/shirabe/src/util/http/mod.rs | 13 | ||||
| -rw-r--r-- | crates/shirabe/src/util/http/proxy_manager.rs | 5 | ||||
| -rw-r--r-- | crates/shirabe/src/util/http/request_proxy.rs | 3 |
5 files changed, 10 insertions, 29 deletions
diff --git a/crates/shirabe/src/util/http/curl_downloader.rs b/crates/shirabe/src/util/http/curl_downloader.rs index 66ca326..019a5ab 100644 --- a/crates/shirabe/src/util/http/curl_downloader.rs +++ b/crates/shirabe/src/util/http/curl_downloader.rs @@ -10,15 +10,6 @@ //! is preserved. Per-request TLS/proxy/IP-resolve settings that reqwest only exposes per-Client //! are simplified to a single default Client; see the TODOs below. -use std::sync::atomic::{AtomicBool, Ordering}; - -use indexmap::IndexMap; - -use shirabe_external_packages::composer::pcre::Preg; -use shirabe_php_shim::{ - PhpMixed, in_array, parse_url, preg_quote, rename, strpos, substr, unlink_silent, -}; - use crate::config::Config; use crate::downloader::MaxFileSizeExceededException; use crate::downloader::TransportException; @@ -31,6 +22,12 @@ use crate::util::http::CurlResponse; use crate::util::http::ProxyManager; use crate::util::http::Response; use crate::util::{AuthHelper, PromptAuthResult, StoreAuth}; +use indexmap::IndexMap; +use shirabe_external_packages::composer::pcre::Preg; +use shirabe_php_shim::{ + PhpMixed, in_array, parse_url, preg_quote, rename, strpos, substr, unlink_silent, +}; +use std::sync::atomic::{AtomicBool, Ordering}; /// resolve callback supplied by `HttpDownloader`. Receives the final `Response` on success. pub type ResolveCallback = Box<dyn Fn(Response) + Send + Sync>; diff --git a/crates/shirabe/src/util/http/curl_response.rs b/crates/shirabe/src/util/http/curl_response.rs index cc3d21b..579bba8 100644 --- a/crates/shirabe/src/util/http/curl_response.rs +++ b/crates/shirabe/src/util/http/curl_response.rs @@ -1,10 +1,9 @@ //! ref: composer/src/Composer/Util/Http/CurlResponse.php +use super::Response; use indexmap::IndexMap; use shirabe_php_shim::PhpMixed; -use super::Response; - #[derive(Debug)] pub struct CurlResponse { pub(crate) inner: Response, diff --git a/crates/shirabe/src/util/http/mod.rs b/crates/shirabe/src/util/http/mod.rs deleted file mode 100644 index 19e5a86..0000000 --- a/crates/shirabe/src/util/http/mod.rs +++ /dev/null @@ -1,13 +0,0 @@ -pub mod curl_downloader; -pub mod curl_response; -pub mod proxy_item; -pub mod proxy_manager; -pub mod request_proxy; -pub mod response; - -pub use curl_downloader::*; -pub use curl_response::*; -pub use proxy_item::*; -pub use proxy_manager::*; -pub use request_proxy::*; -pub use response::*; diff --git a/crates/shirabe/src/util/http/proxy_manager.rs b/crates/shirabe/src/util/http/proxy_manager.rs index d0ff9d9..3bc0888 100644 --- a/crates/shirabe/src/util/http/proxy_manager.rs +++ b/crates/shirabe/src/util/http/proxy_manager.rs @@ -1,12 +1,11 @@ //! ref: composer/src/Composer/Util/Http/ProxyManager.php -use std::sync::atomic::{AtomicU64, Ordering}; -use std::sync::{Mutex, OnceLock}; - use crate::downloader::TransportException; use crate::util::NoProxyPattern; use crate::util::http::ProxyItem; use crate::util::http::RequestProxy; +use std::sync::atomic::{AtomicU64, Ordering}; +use std::sync::{Mutex, OnceLock}; static INSTANCE: OnceLock<Mutex<Option<ProxyManager>>> = OnceLock::new(); diff --git a/crates/shirabe/src/util/http/request_proxy.rs b/crates/shirabe/src/util/http/request_proxy.rs index 49aa885..1262622 100644 --- a/crates/shirabe/src/util/http/request_proxy.rs +++ b/crates/shirabe/src/util/http/request_proxy.rs @@ -1,13 +1,12 @@ //! ref: composer/src/Composer/Util/Http/RequestProxy.php +use crate::downloader::TransportException; use indexmap::IndexMap; use shirabe_php_shim::{ CURLAUTH_BASIC, CURLOPT_NOPROXY, CURLOPT_PROXY, CURLOPT_PROXY_CAINFO, CURLOPT_PROXY_CAPATH, CURLOPT_PROXYAUTH, CURLOPT_PROXYUSERPWD, InvalidArgumentException, PhpMixed, }; -use crate::downloader::TransportException; - // contextOptions = array{http: array{proxy: string, header?: string, request_fulluri?: bool}} type ContextOptions = IndexMap<String, IndexMap<String, PhpMixed>>; |
