From 11ccd034109224849fff54c12785e454deba6741 Mon Sep 17 00:00:00 2001 From: Namilskyy Date: Sat, 29 Nov 2025 12:36:24 +0300 Subject: Fixed much warnings, some refactors and additions. --- src/i2impl/mi2p.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/i2impl') diff --git a/src/i2impl/mi2p.rs b/src/i2impl/mi2p.rs index 9fa05bf..9faef34 100644 --- a/src/i2impl/mi2p.rs +++ b/src/i2impl/mi2p.rs @@ -1,6 +1,7 @@ use crate::cfg::config::Config; +use serde::de::value::StrDeserializer; use tokio; use emissary_core::runtime::{ AsyncRead, @@ -44,14 +45,14 @@ impl I2PStatus { } */ -struct I2P { - session: Option>, +struct I2P { + session: Option>, connected: bool, config: Config, } -impl I2P { +impl I2P { /// Creates a new I2P object with the given configuration. /// /// # Returns @@ -73,6 +74,11 @@ impl I2P { /// /// Returns an error if the repository URL is invalid or if the request fails. /// + /// # Shortcomings + /// - Currently, &str is used instead of Path. + /// - An incomplete I2P structure, the session is stored in the structure but + /// is recreated when called, perhaps the connection/disconnection methods should be encapsulated, + /// although the function is not used often so it will not carry major changes pub async fn fetch_index(&mut self) -> Result { let repo_url_str = &self.config.repo.repo_url; let cache_dir = &self.config.paths.cache_dir; @@ -87,7 +93,7 @@ impl I2P { // HTTP path let request_path = format!("/repo{}{}", path_suffix, if path_suffix.ends_with(".tar.gz") { "" } else { "/INDEX.tar.gz" }); - let mut opts = SessionOptions::default(); + let opts = SessionOptions::default(); // FIXME: Make sure, opts setted to I2P // opts.set_host("127.0.0.1"); // opts.set_port(7656); -- cgit v1.2.3