From 703eb74e2526a2244e0289621e88a946b72b8ec4 Mon Sep 17 00:00:00 2001 From: Michal Date: Thu, 21 Jul 2022 14:33:44 +0100 Subject: [PATCH] Big FMT job --- flake.nix | 62 ++++++++++++++++++++++------------------- src/args.rs | 1 - src/operations/clean.rs | 2 +- src/operations/clone.rs | 3 +- src/operations/mod.rs | 4 +-- src/operations/pull.rs | 2 +- 6 files changed, 39 insertions(+), 35 deletions(-) diff --git a/flake.nix b/flake.nix index f72710c..17be9ac 100644 --- a/flake.nix +++ b/flake.nix @@ -5,36 +5,40 @@ naersk.url = "github:nix-community/naersk"; }; - outputs = { self, nixpkgs, utils, naersk }: - utils.lib.eachDefaultSystem (system: - let - pkgs = nixpkgs.legacyPackages."${system}"; - naersk-lib = naersk.lib."${system}"; - in rec - { - packages.malachite = naersk-lib.buildPackage { - pname = "mlc"; - root = ./.; - }; - - packages.default = packages.malachite; + outputs = { + self, + nixpkgs, + utils, + naersk, + }: + utils.lib.eachDefaultSystem (system: let + pkgs = nixpkgs.legacyPackages."${system}"; + naersk-lib = naersk.lib."${system}"; + in rec + { + packages.malachite = naersk-lib.buildPackage { + pname = "mlc"; + root = ./.; + }; - apps.malachite = utils.lib.mkApp { - drv = packages.malachite; - }; - - apps.default = apps.malachite; + packages.default = packages.malachite; - devShells.default = pkgs.mkShell { - nativeBuildInputs = with pkgs; [ - rustc - cargo - rustfmt - cargo-audit - clippy - ]; - }; + apps.malachite = utils.lib.mkApp { + drv = packages.malachite; + }; - formatter = pkgs.alejandra; - }); + apps.default = apps.malachite; + + devShells.default = pkgs.mkShell { + nativeBuildInputs = with pkgs; [ + rustc + cargo + rustfmt + cargo-audit + clippy + ]; + }; + + formatter = pkgs.alejandra; + }); } diff --git a/src/args.rs b/src/args.rs index 4eb3eb4..081ff16 100644 --- a/src/args.rs +++ b/src/args.rs @@ -17,7 +17,6 @@ pub struct Args { /// Excludes packages from given operation, if applicable #[clap(short = 'x', long = "exclude", action = ArgAction::Append, takes_value = true)] pub exclude: Vec, - } #[derive(Debug, Clone, Subcommand)] diff --git a/src/operations/clean.rs b/src/operations/clean.rs index 68f21e7..e39cea5 100644 --- a/src/operations/clean.rs +++ b/src/operations/clean.rs @@ -13,4 +13,4 @@ pub fn clean() { for dir in dirs { std::fs::remove_dir_all(dir).unwrap(); } -} \ No newline at end of file +} diff --git a/src/operations/clone.rs b/src/operations/clone.rs index 365a592..0d5c1ab 100644 --- a/src/operations/clone.rs +++ b/src/operations/clone.rs @@ -1,6 +1,7 @@ -use crate::{info, workspace}; use std::process::Command; +use crate::{info, workspace}; + pub fn clone() { // Read config struct from mlc.toml let config = workspace::read_cfg(); diff --git a/src/operations/mod.rs b/src/operations/mod.rs index bbba783..1a251dd 100644 --- a/src/operations/mod.rs +++ b/src/operations/mod.rs @@ -1,11 +1,11 @@ pub use build::*; +pub use clean::*; pub use clone::*; pub use config::*; pub use pull::*; -pub use clean::*; mod build; +mod clean; mod clone; mod config; mod pull; -mod clean; diff --git a/src/operations/pull.rs b/src/operations/pull.rs index c550206..50c829d 100644 --- a/src/operations/pull.rs +++ b/src/operations/pull.rs @@ -1,8 +1,8 @@ -use crate::{crash, internal::AppExitCode}; use std::env; use std::process::Command; use crate::info; +use crate::{crash, internal::AppExitCode}; fn do_the_pulling(repos: Vec) { for repo in repos {