diff options
| author | Namilskyy <alive6863@gmail.com> | 2025-12-07 14:29:35 +0300 |
|---|---|---|
| committer | Namilskyy <alive6863@gmail.com> | 2025-12-07 14:29:35 +0300 |
| commit | 778a979e2e774e1b2e91227fa2db2e56d41927c1 (patch) | |
| tree | ae1560e203477a90edc089c1832e37af83f43540 /src/net | |
| parent | e7c49d685efe768c0c1d9c66da7b93b6e118b305 (diff) | |
Fixed logical issues
Diffstat (limited to 'src/net')
| -rw-r--r-- | src/net/http_package.rs | 5 | ||||
| -rw-r--r-- | src/net/i2p_package.rs | 12 |
2 files changed, 6 insertions, 11 deletions
diff --git a/src/net/http_package.rs b/src/net/http_package.rs index 4566e05..4924805 100644 --- a/src/net/http_package.rs +++ b/src/net/http_package.rs @@ -12,9 +12,8 @@ use std::{collections::HashMap, path::Path}; use tar::Archive; use tokio::{fs::File, io::AsyncWriteExt}; -use crate::pkgtoolkit::install::InstallOperations; use crate::pkgtoolkit::archive::ArchiveOperations; - +use crate::pkgtoolkit::install::InstallOperations; pub struct HTTPPackage { pub config: Config, @@ -278,7 +277,7 @@ impl HTTPPackage { // Install the package log::info!("Installing package '{}'...", package_name); let mut package = package_info.clone(); - + match package.install() { Ok(_) => { log::info!("Package '{}' installed successfully.", package_name); diff --git a/src/net/i2p_package.rs b/src/net/i2p_package.rs index cebfa34..fed3361 100644 --- a/src/net/i2p_package.rs +++ b/src/net/i2p_package.rs @@ -1,5 +1,7 @@ use crate::cfg::config::Config; use crate::pkgtoolkit::Package; +use crate::pkgtoolkit::archive::ArchiveOperations; +use crate::pkgtoolkit::install::InstallOperations; use flate2::read::GzDecoder; use futures_util::stream::TryStreamExt; use indicatif::{ProgressBar, ProgressStyle}; @@ -9,9 +11,6 @@ use std::fs::File as StdFile; use std::{collections::HashMap, path::Path}; use tar::Archive; use tokio::{fs::File, io::AsyncWriteExt}; -use crate::pkgtoolkit::archive::ArchiveOperations; -use crate::pkgtoolkit::install::InstallOperations; - pub struct I2PPackage { pub config: Config, @@ -44,9 +43,7 @@ impl I2PPackage { fn create_proxy_client(&self) -> Result<reqwest::Client, Box<dyn std::error::Error>> { let proxy_url = format!("http://127.0.0.1:{}", self.config.repo.i2p_http_proxy_port); let proxy = reqwest::Proxy::http(&proxy_url)?; - let client = reqwest::Client::builder() - .proxy(proxy) - .build()?; + let client = reqwest::Client::builder().proxy(proxy).build()?; Ok(client) } @@ -182,7 +179,6 @@ impl I2PPackage { file_path: &Path, description: &str, ) -> Result<(), Box<dyn std::error::Error>> { - let head_response = client.head(url).send().await?; let content_length: u64 = head_response .headers() @@ -275,7 +271,7 @@ impl I2PPackage { // Install the package log::info!("Installing package '{}'...", package_name); let mut package = package_info.clone(); - + match package.install() { Ok(_) => { log::info!("Package '{}' installed successfully.", package_name); |
