From 6694c50c4d2ec528b3ca6a54f72688bbace9ce4e Mon Sep 17 00:00:00 2001 From: Michal Date: Thu, 21 Jul 2022 16:36:57 +0100 Subject: [PATCH] Fmt and whatnot --- src/operations/build.rs | 4 ++-- src/operations/mod.rs | 4 ++-- src/operations/prune.rs | 13 ++++++------- src/operations/pull.rs | 2 +- src/repository/config.rs | 2 +- src/repository/package.rs | 4 ++-- src/repository/repo.rs | 2 +- src/workspace/read.rs | 4 ++-- 8 files changed, 17 insertions(+), 18 deletions(-) diff --git a/src/operations/build.rs b/src/operations/build.rs index d7a5015..f22fdef 100644 --- a/src/operations/build.rs +++ b/src/operations/build.rs @@ -1,6 +1,6 @@ -use crate::{crash, info, log, repository, workspace}; -use crate::internal::AppExitCode; use crate::internal::structs::{ErroredPackage, Repo}; +use crate::internal::AppExitCode; +use crate::{crash, info, log, repository, workspace}; pub fn build(packages: Vec, exclude: Vec, no_regen: bool, verbose: bool) { // Read config struct from mlc.toml diff --git a/src/operations/mod.rs b/src/operations/mod.rs index e2afbff..6588e22 100644 --- a/src/operations/mod.rs +++ b/src/operations/mod.rs @@ -2,12 +2,12 @@ pub use build::*; pub use clean::*; pub use clone::*; pub use config::*; -pub use pull::*; pub use prune::*; +pub use pull::*; mod build; mod clean; mod clone; mod config; +mod prune; mod pull; -mod prune; \ No newline at end of file diff --git a/src/operations/prune.rs b/src/operations/prune.rs index b412064..e8372b6 100644 --- a/src/operations/prune.rs +++ b/src/operations/prune.rs @@ -1,9 +1,9 @@ -use std::env; -use std::path::PathBuf; -use std::fs; use crate::info; use crate::log; use crate::read_cfg; +use std::env; +use std::fs; +use std::path::PathBuf; #[derive(Debug, Clone)] struct PackageFile { @@ -97,9 +97,8 @@ pub fn prune(verbose: bool) { for p in packages_to_delete.iter() { let path = format!("{}-{}-{}", p.name, p.ver, p.ext); log!(verbose, "Deleting {}", path); - std::process::Command::new("bash").args(&["-c", - &format!("rm -rf ./{} ./{}.sig", path, path) - ]) + std::process::Command::new("bash") + .args(&["-c", &format!("rm -rf ./{} ./{}.sig", path, path)]) .output() .unwrap(); } @@ -113,4 +112,4 @@ pub fn prune(verbose: bool) { for p in packages_to_delete.iter_mut() { info!("{}-{}-{}", p.name, p.ver, p.ext); } -} \ No newline at end of file +} diff --git a/src/operations/pull.rs b/src/operations/pull.rs index cdab0fa..daf31e3 100644 --- a/src/operations/pull.rs +++ b/src/operations/pull.rs @@ -1,8 +1,8 @@ use std::env; use std::process::Command; -use crate::{crash, internal::AppExitCode, log}; use crate::info; +use crate::{crash, internal::AppExitCode, log}; fn do_the_pulling(repos: Vec, verbose: bool) { for repo in repos { diff --git a/src/repository/config.rs b/src/repository/config.rs index 29a1c3a..4ac4c3a 100644 --- a/src/repository/config.rs +++ b/src/repository/config.rs @@ -3,8 +3,8 @@ use std::fs::File; use std::io::Write; use std::path::Path; -use crate::{crash, log}; use crate::internal::AppExitCode; +use crate::{crash, log}; const DEFAULT_CONFIG: &str = r#" # Either "repository" or "workspace" diff --git a/src/repository/package.rs b/src/repository/package.rs index 73d8c9e..e8ac524 100755 --- a/src/repository/package.rs +++ b/src/repository/package.rs @@ -1,9 +1,9 @@ -use std::{env, fs}; use std::path::Path; use std::process::Command; +use std::{env, fs}; -use crate::{crash, log}; use crate::internal::AppExitCode; +use crate::{crash, log}; pub fn build(pkg: &str, sign: bool, verbose: bool) -> i32 { log!(verbose, "Building {}", pkg); diff --git a/src/repository/repo.rs b/src/repository/repo.rs index fe5b629..9dab54a 100644 --- a/src/repository/repo.rs +++ b/src/repository/repo.rs @@ -1,6 +1,6 @@ -use std::{env, fs}; use std::path::Path; use std::process::Command; +use std::{env, fs}; use crate::{log, workspace::read_cfg}; diff --git a/src/workspace/read.rs b/src/workspace/read.rs index 681aeb9..85781fb 100755 --- a/src/workspace/read.rs +++ b/src/workspace/read.rs @@ -1,9 +1,9 @@ use std::fs; use std::path::Path; -use crate::{crash, log}; -use crate::internal::AppExitCode; use crate::internal::structs::{Config, Repo, SplitRepo, UnexpandedConfig}; +use crate::internal::AppExitCode; +use crate::{crash, log}; pub fn read_cfg(verbose: bool) -> Config { // Crash if mlc.toml doesn't exist