From d349bfb978a9b6b50fe43fdbe3b5f4ca38c19e2c Mon Sep 17 00:00:00 2001 From: Didier Date: Mon, 7 Aug 2023 04:32:27 +0200 Subject: [PATCH] fix: optimize imports --- pkgr/src/commands.rs | 6 +++--- pkgr/src/logging.rs | 3 ++- pkgr/src/main.rs | 5 ++--- pkgr/src/package/installer/mod.rs | 8 +++++--- pkgr/src/package/mod.rs | 5 ++++- pkgr/src/process.rs | 2 +- pkgr/src/tmpfs.rs | 1 + 7 files changed, 18 insertions(+), 12 deletions(-) diff --git a/pkgr/src/commands.rs b/pkgr/src/commands.rs index 9440645..52e6fb4 100644 --- a/pkgr/src/commands.rs +++ b/pkgr/src/commands.rs @@ -1,11 +1,11 @@ -use crate::package::identifier::PackageIdentifier; +use std::process::exit; -use crate::package::Package; use clap::{Parser, Subcommand}; use log::{debug, error, info, trace, warn}; -use std::process::exit; use crate::CONFIG; +use crate::package::identifier::PackageIdentifier; +use crate::package::Package; use crate::process::Process; use crate::types::fetch::TryFetch; diff --git a/pkgr/src/logging.rs b/pkgr/src/logging.rs index 5cc511a..f16df2d 100644 --- a/pkgr/src/logging.rs +++ b/pkgr/src/logging.rs @@ -1,7 +1,8 @@ +use std::env; + use colored::Colorize; use fern::Dispatch; use log::{Record, SetLoggerError}; -use std::env; fn format_regular>(log: S, record: &Record) -> String { let log = log.into(); diff --git a/pkgr/src/main.rs b/pkgr/src/main.rs index 3320e71..04a8ec4 100644 --- a/pkgr/src/main.rs +++ b/pkgr/src/main.rs @@ -1,9 +1,8 @@ -use crate::commands::Cli; - use clap::Parser; - use log::trace; +use crate::commands::Cli; + mod commands; mod logging; mod package; diff --git a/pkgr/src/package/installer/mod.rs b/pkgr/src/package/installer/mod.rs index 3300ddf..52852f5 100644 --- a/pkgr/src/package/installer/mod.rs +++ b/pkgr/src/package/installer/mod.rs @@ -1,13 +1,15 @@ -use crate::tmpfs::TempDir; -use errors::{BinError, BuildError, InstallError}; +use std::process::exit; + use log::{debug, error, info, trace}; + +use errors::{BinError, BuildError, InstallError}; use manifest::Manifest; use pkgfile::PKGFile; -use std::process::exit; use crate::CONFIG; use crate::package::identifier::{PackageIdentifier, PackageLocator}; use crate::package::Package; +use crate::tmpfs::TempDir; use crate::types::fetch::TryFetch; pub mod errors; diff --git a/pkgr/src/package/mod.rs b/pkgr/src/package/mod.rs index 9ade687..a0c0fd0 100644 --- a/pkgr/src/package/mod.rs +++ b/pkgr/src/package/mod.rs @@ -1,8 +1,11 @@ use std::fmt::Display; use std::path::Path; -use log::{info, trace}; + +use log::info; use reqwest::blocking::get; + use pkgfile::PKGFile; + use crate::package::identifier::PackageIdentifier; use crate::types::fetch::TryFetch; diff --git a/pkgr/src/process.rs b/pkgr/src/process.rs index f6f4e21..fbaf567 100644 --- a/pkgr/src/process.rs +++ b/pkgr/src/process.rs @@ -1,7 +1,7 @@ use std::io::{BufRead, BufReader}; use std::process::Command; -use log::{info, trace}; +use log::{info, trace}; pub struct Process { pub command: Vec, diff --git a/pkgr/src/tmpfs.rs b/pkgr/src/tmpfs.rs index d21aff7..74c21b8 100644 --- a/pkgr/src/tmpfs.rs +++ b/pkgr/src/tmpfs.rs @@ -1,4 +1,5 @@ use std::path::PathBuf; + use crate::CONFIG; pub struct TempDir {