From 4626533269aa961bf08d0b3f9bd2e7439311ad9b Mon Sep 17 00:00:00 2001 From: Raine Date: Sat, 14 Oct 2023 22:39:46 +0200 Subject: [PATCH] fix: cargo fix --- pkgr/src/commands.rs | 10 +++++----- pkgr/src/logging.rs | 2 +- pkgr/src/main.rs | 6 +++--- pkgr/src/package/fetch.rs | 6 +++--- pkgr/src/package/installer/mod.rs | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/pkgr/src/commands.rs b/pkgr/src/commands.rs index 4393869..a1904a7 100644 --- a/pkgr/src/commands.rs +++ b/pkgr/src/commands.rs @@ -1,9 +1,9 @@ use crate::package::identifier::PackageIdentifier; -use crate::package::installer::{InstallType, PackageInstaller}; + use crate::package::Package; use clap::{Parser, Subcommand}; use log::{debug, error, info, trace, warn}; -use manifest::Manifest; + use std::process::exit; use crate::CONFIG; use crate::process::Process; @@ -54,7 +54,7 @@ impl Command { warn!("Installer does not run in isolation."); let start = std::time::Instant::now(); - let unix_start = std::time::SystemTime::now() + let _unix_start = std::time::SystemTime::now() .duration_since(std::time::UNIX_EPOCH) .unwrap(); @@ -80,7 +80,7 @@ impl Command { } let end = std::time::Instant::now(); - let unix_end = std::time::SystemTime::now() + let _unix_end = std::time::SystemTime::now() .duration_since(std::time::UNIX_EPOCH) .unwrap(); @@ -117,7 +117,7 @@ impl Command { Process::command(vec!["sh", "-c", "echo whoami: $(whoami)"]) .spawn() .unwrap(); - if let Ok(user) = std::env::var("SUDO_USER") { + if let Ok(_user) = std::env::var("SUDO_USER") { Process::command(vec!["sh", "-c", "echo sudo_user: $SUDO_USER"]) .spawn() .unwrap(); diff --git a/pkgr/src/logging.rs b/pkgr/src/logging.rs index 5e32d9d..47a66bc 100644 --- a/pkgr/src/logging.rs +++ b/pkgr/src/logging.rs @@ -28,7 +28,7 @@ fn format_regular>(log: S, record: &Record) -> String { let mut lines = log.lines().peekable(); let mut output = match lines.peek() { - Some(line) => line_prefix(lines.next().unwrap().to_string(), false), + Some(_line) => line_prefix(lines.next().unwrap().to_string(), false), None => return "".to_string(), }; diff --git a/pkgr/src/main.rs b/pkgr/src/main.rs index 97f721f..0191923 100644 --- a/pkgr/src/main.rs +++ b/pkgr/src/main.rs @@ -1,9 +1,9 @@ use crate::commands::Cli; -use crate::process::Process; + use clap::Parser; -use colored::Colorize; + use log::trace; -use std::process::Command; + mod commands; mod logging; diff --git a/pkgr/src/package/fetch.rs b/pkgr/src/package/fetch.rs index a97dfb6..bc385ea 100644 --- a/pkgr/src/package/fetch.rs +++ b/pkgr/src/package/fetch.rs @@ -34,7 +34,7 @@ pub fn fetch_by_uri>(uri: S) -> Result { // get file contents as bytes let mut bytes = Vec::new(); match get(uri.into()) { - Ok(mut response) => { + Ok(response) => { match response.take(1024 * 1024).read_to_end(&mut bytes) { Ok(_) => (), Err(e) => return Err(FetchError::IOError(e)), @@ -45,11 +45,11 @@ pub fn fetch_by_uri>(uri: S) -> Result { // parse bytes as PKGFile match PKGFile::try_from(bytes) { Ok(pkgfile) => Ok(pkgfile), - Err(e) => Err(FetchError::ParseError), + Err(_e) => Err(FetchError::ParseError), } } -pub fn fetch_by_package_locator(package_locator: PackageLocator) -> Result { +pub fn fetch_by_package_locator(_package_locator: PackageLocator) -> Result { // TODO: search index for package locator Ok(PKGFile::default()) } diff --git a/pkgr/src/package/installer/mod.rs b/pkgr/src/package/installer/mod.rs index 5da81f9..a28f849 100644 --- a/pkgr/src/package/installer/mod.rs +++ b/pkgr/src/package/installer/mod.rs @@ -3,7 +3,7 @@ use errors::{BinError, BuildError, InstallError}; use log::{debug, error, info, trace}; use manifest::Manifest; use pkgfile::PKGFile; -use std::fmt::Display; + use std::process::exit; use crate::CONFIG; use crate::package::identifier::{PackageIdentifier, PackageLocator};