summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNamilskyy <alive6863@gmail.com>2025-12-01 15:14:58 +0300
committerNamilskyy <alive6863@gmail.com>2025-12-01 15:14:58 +0300
commit84b5aa13a0e6e5c8c9884ae3f973e560e7d4c59b (patch)
tree5e87585744a8e9e8063ba5e755e17771e5a280d4 /src
parent4262072d0d79449da6b94fb8863064c3fe7998d5 (diff)
Fixed test logic and formatted code
Diffstat (limited to 'src')
-rw-r--r--src/cfg/config.rs6
-rw-r--r--src/net/http_package.rs10
-rw-r--r--src/pkgtoolkit/pkgtools.rs11
3 files changed, 15 insertions, 12 deletions
diff --git a/src/cfg/config.rs b/src/cfg/config.rs
index 521ffcc..08cdbd9 100644
--- a/src/cfg/config.rs
+++ b/src/cfg/config.rs
@@ -71,7 +71,11 @@ impl Config {
repo_url: format!("https://mesk.anthrill.i2p/repo/{}/", std::env::consts::ARCH),
auto_update: true,
destination: (String::from("mesk"), String::from("mesk")),
- repo_http_url: format!("http://github.com/Anthrill/repo-mirror/{}", std::env::consts::ARCH).into(),
+ repo_http_url: format!(
+ "http://github.com/Anthrill/repo-mirror/{}",
+ std::env::consts::ARCH
+ )
+ .into(),
// Its a hurt place, you need to generate destinations by i2pd and paste here (to mesk.toml)
// Better to leave it empty or set it to (mesk, mesk), now destination conn not implemented
},
diff --git a/src/net/http_package.rs b/src/net/http_package.rs
index 92b5ffc..4b2aefa 100644
--- a/src/net/http_package.rs
+++ b/src/net/http_package.rs
@@ -47,12 +47,14 @@ impl HTTPPackage {
let index_url = repo_url_opt.as_deref().map_or_else(
|| {
- log::warn!("Repository URL is None, please specify it in /etc/mesk/mesk.toml and restart.");
- String::new()
+ log::warn!(
+ "Repository URL is None, please specify it in /etc/mesk/mesk.toml and restart."
+ );
+ String::new()
},
- |repo_url_str| {
+ |repo_url_str| {
if repo_url_str.ends_with(".tar.gz") {
- repo_url_str.to_string()
+ repo_url_str.to_string()
} else {
format!("{}/INDEX.tar.gz", repo_url_str.trim_end_matches('/'))
}
diff --git a/src/pkgtoolkit/pkgtools.rs b/src/pkgtoolkit/pkgtools.rs
index 0105a11..a0433ac 100644
--- a/src/pkgtoolkit/pkgtools.rs
+++ b/src/pkgtoolkit/pkgtools.rs
@@ -42,7 +42,7 @@ pub struct InstallMeta {
user: String,
group: String,
mode: String,
- //! Cancels the previous fields and installs them using the shell script
+ // Cancels the previous fields and installs them using the shell script
custom_script: Option<String>,
}
@@ -56,9 +56,9 @@ struct Install {
#[allow(dead_code)]
#[derive(Deserialize, Debug)]
struct Setts {
- //! Export environment variables if this needed
+ // Export environment variables if this needed
env: Option<String>,
- //! Test the package after installation
+ // Test the package after installation
test: Option<String>,
}
@@ -306,9 +306,7 @@ impl Package {
Self::extract_archive(&path_to_archive)?;
let archive_path = Path::new(&path_to_archive);
- let archive_dir = archive_path
- .parent()
- .unwrap_or_else(|| Path::new("."));
+ let archive_dir = archive_path.parent().unwrap_or_else(|| Path::new("."));
let install_path = archive_dir.join("INSTALL");
let setts_path = archive_dir.join("SETTS");
@@ -355,7 +353,6 @@ impl Package {
log::info!("Validating arch...");
-
let install_parsed = match install_content {
Ok(v) => v,
Err(e) => {