summaryrefslogtreecommitdiff
path: root/src/net/i2p_package.rs
diff options
context:
space:
mode:
authorNamilskyy <alive6863@gmail.com>2025-12-07 14:29:35 +0300
committerNamilskyy <alive6863@gmail.com>2025-12-07 14:29:35 +0300
commit778a979e2e774e1b2e91227fa2db2e56d41927c1 (patch)
treeae1560e203477a90edc089c1832e37af83f43540 /src/net/i2p_package.rs
parente7c49d685efe768c0c1d9c66da7b93b6e118b305 (diff)
Fixed logical issues
Diffstat (limited to 'src/net/i2p_package.rs')
-rw-r--r--src/net/i2p_package.rs12
1 files changed, 4 insertions, 8 deletions
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);