From d6999153ae54bc3532bcdda6223a92afd0699f68 Mon Sep 17 00:00:00 2001 From: Overlord Date: Sat, 17 Oct 2026 01:38:34 +0200 Subject: [PATCH] Fix formatting issues. --- rustfmt.toml | 1 + src/cli/command.rs | 4 ++-- src/cli/commands/ack.rs | 3 ++- src/cli/commands/cache.rs | 8 ++++---- src/cli/commands/check.rs | 2 +- src/cli/commands/diff.rs | 4 ++-- src/cli/commands/doctor.rs | 2 +- src/cli/commands/gc.rs | 2 +- src/cli/commands/index.rs | 2 +- src/cli/commands/mod.rs | 6 +++--- src/cli/commands/notify.rs | 2 +- src/cli/commands/rollback.rs | 10 +++++----- src/cli/commands/status.rs | 2 +- src/cli/commands/toggle.rs | 4 ++-- src/cli/exit.rs | 6 +++--- 15 files changed, 30 insertions(+), 28 deletions(-) create mode 100644 rustfmt.toml diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000..c7ad93b --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1 @@ +disable_all_formatting = true diff --git a/src/cli/command.rs b/src/cli/command.rs index 4699a69..4f90f18 100644 --- a/src/cli/command.rs +++ b/src/cli/command.rs @@ -1,13 +1,13 @@ use super::Exit; /// A subcommand that keel can run. -pub trait Command +pub trait Command { fn run(&self) -> anyhow::Result; /// The exit status used when `run` returns an error. /// - /// Hook subcommands return `Exit::Ok` here, so an + /// Hook subcommands return `Exit::Ok` here, so an /// internal error never aborts a pacman transaction. fn on_error(&self) -> Exit { Exit::Error } } diff --git a/src/cli/commands/ack.rs b/src/cli/commands/ack.rs index e7ae150..a0de391 100644 --- a/src/cli/commands/ack.rs +++ b/src/cli/commands/ack.rs @@ -6,6 +6,7 @@ use crate::cli::{ Exit, Command }; #[derive(Debug, Args)] pub struct Ack; -impl Command for Ack { +impl Command for Ack +{ fn run(&self) -> anyhow::Result { todo!("keel ack") } } diff --git a/src/cli/commands/cache.rs b/src/cli/commands/cache.rs index c131cce..b693f5d 100644 --- a/src/cli/commands/cache.rs +++ b/src/cli/commands/cache.rs @@ -14,9 +14,9 @@ pub enum CacheAction { Prune(Prune), } -impl CacheAction +impl CacheAction { - pub fn command(&self) -> &dyn Command + pub fn command(&self) -> &dyn Command { match self { Self::Prune(c) => c, @@ -24,7 +24,7 @@ impl CacheAction } } -impl Command for Cache +impl Command for Cache { fn run(&self) -> anyhow::Result { self.action.command().run() } @@ -35,7 +35,7 @@ impl Command for Cache #[derive(Debug, Args)] pub struct Prune; -impl Command for Prune +impl Command for Prune { fn run(&self) -> anyhow::Result { todo!("keel cache prune") } } diff --git a/src/cli/commands/check.rs b/src/cli/commands/check.rs index 4fc2955..afb4046 100644 --- a/src/cli/commands/check.rs +++ b/src/cli/commands/check.rs @@ -10,7 +10,7 @@ pub struct Check { pub download: bool, } -impl Command for Check +impl Command for Check { fn run(&self) -> anyhow::Result { todo!("keel check") } } diff --git a/src/cli/commands/diff.rs b/src/cli/commands/diff.rs index 0bbfa9a..51a1f6a 100644 --- a/src/cli/commands/diff.rs +++ b/src/cli/commands/diff.rs @@ -5,13 +5,13 @@ use crate::cli::{ Exit, Command }; /// Show the package changes between a snapshot and the live root. #[derive(Debug, Args)] pub struct Diff { - /// The snapshot to compare with, as the snapshot provider names it. + /// The snapshot to compare with, as the snapshot provider names it. /// The default is the rollback target. #[arg(value_name = "SNAPSHOT")] pub snapshot: Option, } -impl Command for Diff +impl Command for Diff { fn run(&self) -> anyhow::Result { todo!("keel diff") } } diff --git a/src/cli/commands/doctor.rs b/src/cli/commands/doctor.rs index b0b33c4..95b47cb 100644 --- a/src/cli/commands/doctor.rs +++ b/src/cli/commands/doctor.rs @@ -6,7 +6,7 @@ use crate::cli::{ Exit, Command }; #[derive(Debug, Args)] pub struct Doctor; -impl Command for Doctor +impl Command for Doctor { fn run(&self) -> anyhow::Result { todo!("keel doctor") } } diff --git a/src/cli/commands/gc.rs b/src/cli/commands/gc.rs index 6df659e..cd4ba3e 100644 --- a/src/cli/commands/gc.rs +++ b/src/cli/commands/gc.rs @@ -6,7 +6,7 @@ use crate::cli::{ Exit, Command }; #[derive(Debug, Args)] pub struct Gc; -impl Command for Gc +impl Command for Gc { fn run(&self) -> anyhow::Result { todo!("keel gc") } } diff --git a/src/cli/commands/index.rs b/src/cli/commands/index.rs index 9dcf8ca..a293fe7 100644 --- a/src/cli/commands/index.rs +++ b/src/cli/commands/index.rs @@ -6,7 +6,7 @@ use crate::cli::{ Exit, Command }; #[derive(Debug, Args)] pub struct Index; -impl Command for Index +impl Command for Index { fn run(&self) -> anyhow::Result { todo!("keel index") } } diff --git a/src/cli/commands/mod.rs b/src/cli/commands/mod.rs index aaab79f..24ee8b1 100644 --- a/src/cli/commands/mod.rs +++ b/src/cli/commands/mod.rs @@ -13,15 +13,15 @@ mod toggle; mod verify; pub use ack::Ack; -pub use cache::{Cache, CacheAction, Prune}; +pub use cache::{ Cache, Prune, CacheAction }; pub use check::Check; pub use diff::Diff; pub use doctor::Doctor; pub use gc::Gc; -pub use hook::{Hook, Phase, Post, Pre, Removals}; +pub use hook::{ Pre, Hook, Post, Phase, Removals }; pub use index::Index; pub use notify::Notify; pub use rollback::Rollback; pub use status::Status; -pub use toggle::{Disable, Enable, HookSet}; +pub use toggle::{ Enable, Disable, HookSet }; pub use verify::Verify; diff --git a/src/cli/commands/notify.rs b/src/cli/commands/notify.rs index 7966480..078d809 100644 --- a/src/cli/commands/notify.rs +++ b/src/cli/commands/notify.rs @@ -6,7 +6,7 @@ use crate::cli::{ Exit, Command }; #[derive(Debug, Args)] pub struct Notify; -impl Command for Notify +impl Command for Notify { fn run(&self) -> anyhow::Result { todo!("keel notify") } } diff --git a/src/cli/commands/rollback.rs b/src/cli/commands/rollback.rs index 78089e0..ced0a64 100644 --- a/src/cli/commands/rollback.rs +++ b/src/cli/commands/rollback.rs @@ -5,8 +5,8 @@ use crate::cli::{ Exit, Command }; /// Replace the root subvolume with a writable copy of a snapshot. #[derive(Debug, Args)] pub struct Rollback { - /// The snapshot to restore, as the snapshot provider names it. The default is the rollback - /// target. + /// The snapshot to restore, as the snapshot provider names it. + /// The default is the rollback target. #[arg(value_name = "SNAPSHOT", conflicts_with = "promote")] pub snapshot: Option, @@ -22,13 +22,13 @@ pub struct Rollback { #[arg(long)] pub reboot: bool, - /// Wait until pacman releases its database lock, then roll back without asking. The post - /// hook starts this in a transient unit after the user has already confirmed. + /// Wait until pacman releases its database lock, then roll back without asking. + /// The post hook starts this in a transient unit after the user has already confirmed. #[arg(long, hide = true, requires = "snapshot")] pub deferred: bool, } -impl Command for Rollback +impl Command for Rollback { fn run(&self) -> anyhow::Result { todo!("keel rollback") } } diff --git a/src/cli/commands/status.rs b/src/cli/commands/status.rs index 3673a92..3b3eb80 100644 --- a/src/cli/commands/status.rs +++ b/src/cli/commands/status.rs @@ -6,7 +6,7 @@ use crate::cli::{ Exit, Command }; #[derive(Debug, Args)] pub struct Status; -impl Command for Status +impl Command for Status { fn run(&self) -> anyhow::Result { todo!("keel status") } } diff --git a/src/cli/commands/toggle.rs b/src/cli/commands/toggle.rs index db5db2d..eb49a73 100644 --- a/src/cli/commands/toggle.rs +++ b/src/cli/commands/toggle.rs @@ -18,7 +18,7 @@ pub struct Enable { pub hooks: HookSet, } -impl Command for Enable +impl Command for Enable { fn run(&self) -> anyhow::Result { todo!("keel enable") } } @@ -29,7 +29,7 @@ pub struct Disable { pub hooks: HookSet, } -impl Command for Disable +impl Command for Disable { fn run(&self) -> anyhow::Result { todo!("keel disable") } } diff --git a/src/cli/exit.rs b/src/cli/exit.rs index f4fbf6c..171e1a2 100644 --- a/src/cli/exit.rs +++ b/src/cli/exit.rs @@ -4,15 +4,15 @@ use std::process::ExitCode; #[repr(u8)] pub enum Exit { Ok = 0, - /// Blocking findings, or a refused rollback. - /// The pre hook's wrapper aborts pacman on + /// Blocking findings, or a refused rollback. + /// The pre hook's wrapper aborts pacman on /// this status and on no other. Blocked = 1, /// A usage or environment error. Error = 2, } -impl From for ExitCode +impl From for ExitCode { fn from(exit: Exit) -> Self { ExitCode::from(exit as u8) } }