fix: cargo fix

This commit is contained in:
Strix 2023-10-14 22:39:46 +02:00
parent f4f83f9fa7
commit 4626533269
No known key found for this signature in database
GPG key ID: 49B2E37B8915B774
5 changed files with 13 additions and 13 deletions

View file

@ -1,9 +1,9 @@
use crate::package::identifier::PackageIdentifier; use crate::package::identifier::PackageIdentifier;
use crate::package::installer::{InstallType, PackageInstaller};
use crate::package::Package; use crate::package::Package;
use clap::{Parser, Subcommand}; use clap::{Parser, Subcommand};
use log::{debug, error, info, trace, warn}; use log::{debug, error, info, trace, warn};
use manifest::Manifest;
use std::process::exit; use std::process::exit;
use crate::CONFIG; use crate::CONFIG;
use crate::process::Process; use crate::process::Process;
@ -54,7 +54,7 @@ impl Command {
warn!("Installer does not run in isolation."); warn!("Installer does not run in isolation.");
let start = std::time::Instant::now(); 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) .duration_since(std::time::UNIX_EPOCH)
.unwrap(); .unwrap();
@ -80,7 +80,7 @@ impl Command {
} }
let end = std::time::Instant::now(); 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) .duration_since(std::time::UNIX_EPOCH)
.unwrap(); .unwrap();
@ -117,7 +117,7 @@ impl Command {
Process::command(vec!["sh", "-c", "echo whoami: $(whoami)"]) Process::command(vec!["sh", "-c", "echo whoami: $(whoami)"])
.spawn() .spawn()
.unwrap(); .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"]) Process::command(vec!["sh", "-c", "echo sudo_user: $SUDO_USER"])
.spawn() .spawn()
.unwrap(); .unwrap();

View file

@ -28,7 +28,7 @@ fn format_regular<S: Into<String>>(log: S, record: &Record) -> String {
let mut lines = log.lines().peekable(); let mut lines = log.lines().peekable();
let mut output = match lines.peek() { 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(), None => return "".to_string(),
}; };

View file

@ -1,9 +1,9 @@
use crate::commands::Cli; use crate::commands::Cli;
use crate::process::Process;
use clap::Parser; use clap::Parser;
use colored::Colorize;
use log::trace; use log::trace;
use std::process::Command;
mod commands; mod commands;
mod logging; mod logging;

View file

@ -34,7 +34,7 @@ pub fn fetch_by_uri<S: Into<String>>(uri: S) -> Result<PKGFile, FetchError> {
// get file contents as bytes // get file contents as bytes
let mut bytes = Vec::new(); let mut bytes = Vec::new();
match get(uri.into()) { match get(uri.into()) {
Ok(mut response) => { Ok(response) => {
match response.take(1024 * 1024).read_to_end(&mut bytes) { match response.take(1024 * 1024).read_to_end(&mut bytes) {
Ok(_) => (), Ok(_) => (),
Err(e) => return Err(FetchError::IOError(e)), Err(e) => return Err(FetchError::IOError(e)),
@ -45,11 +45,11 @@ pub fn fetch_by_uri<S: Into<String>>(uri: S) -> Result<PKGFile, FetchError> {
// parse bytes as PKGFile // parse bytes as PKGFile
match PKGFile::try_from(bytes) { match PKGFile::try_from(bytes) {
Ok(pkgfile) => Ok(pkgfile), Ok(pkgfile) => Ok(pkgfile),
Err(e) => Err(FetchError::ParseError), Err(_e) => Err(FetchError::ParseError),
} }
} }
pub fn fetch_by_package_locator(package_locator: PackageLocator) -> Result<PKGFile, FetchError> { pub fn fetch_by_package_locator(_package_locator: PackageLocator) -> Result<PKGFile, FetchError> {
// TODO: search index for package locator // TODO: search index for package locator
Ok(PKGFile::default()) Ok(PKGFile::default())
} }

View file

@ -3,7 +3,7 @@ use errors::{BinError, BuildError, InstallError};
use log::{debug, error, info, trace}; use log::{debug, error, info, trace};
use manifest::Manifest; use manifest::Manifest;
use pkgfile::PKGFile; use pkgfile::PKGFile;
use std::fmt::Display;
use std::process::exit; use std::process::exit;
use crate::CONFIG; use crate::CONFIG;
use crate::package::identifier::{PackageIdentifier, PackageLocator}; use crate::package::identifier::{PackageIdentifier, PackageLocator};