diff --git a/corebox/commands/base32/mod.rs b/corebox/commands/base32/mod.rs index 4f53bea..e4df433 100644 --- a/corebox/commands/base32/mod.rs +++ b/corebox/commands/base32/mod.rs @@ -9,7 +9,7 @@ use std::{ }; use termcolor::{Color, ColorChoice, ColorSpec, StandardStream, WriteColor}; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Base32; impl Cmd for Base32 { diff --git a/corebox/commands/base64/mod.rs b/corebox/commands/base64/mod.rs index 8a60454..159f04a 100644 --- a/corebox/commands/base64/mod.rs +++ b/corebox/commands/base64/mod.rs @@ -8,7 +8,7 @@ use std::{ }; use termcolor::{Color, ColorChoice, ColorSpec, StandardStream, WriteColor}; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Base64; impl Cmd for Base64 { diff --git a/corebox/commands/basename/mod.rs b/corebox/commands/basename/mod.rs index 356e41f..6195c7e 100644 --- a/corebox/commands/basename/mod.rs +++ b/corebox/commands/basename/mod.rs @@ -1,7 +1,7 @@ use super::Cmd; use clap::{Arg, ArgMatches, Command}; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Basename; impl Cmd for Basename { diff --git a/corebox/commands/bootstrap/mod.rs b/corebox/commands/bootstrap/mod.rs index 3f688ef..caa9d7b 100644 --- a/corebox/commands/bootstrap/mod.rs +++ b/corebox/commands/bootstrap/mod.rs @@ -10,7 +10,7 @@ use std::{ path::{Path, PathBuf}, }; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Bootstrap; impl Bootstrap { diff --git a/corebox/commands/chmod/mod.rs b/corebox/commands/chmod/mod.rs index 23835fe..b2a3e1b 100644 --- a/corebox/commands/chmod/mod.rs +++ b/corebox/commands/chmod/mod.rs @@ -11,7 +11,7 @@ use std::{ }; use walkdir::{DirEntry, WalkDir}; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Chmod; impl Cmd for Chmod { diff --git a/corebox/commands/chown/mod.rs b/corebox/commands/chown/mod.rs index fd7859b..5c1200c 100644 --- a/corebox/commands/chown/mod.rs +++ b/corebox/commands/chown/mod.rs @@ -13,7 +13,7 @@ use walkdir::{DirEntry, WalkDir}; mod chgrp; pub use chgrp::Chgrp; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Chown; impl Cmd for Chown { diff --git a/corebox/commands/chroot/mod.rs b/corebox/commands/chroot/mod.rs index b875b60..4be9e0a 100644 --- a/corebox/commands/chroot/mod.rs +++ b/corebox/commands/chroot/mod.rs @@ -6,7 +6,7 @@ use std::{ process, }; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Chroot; impl Cmd for Chroot { diff --git a/corebox/commands/corebox/mod.rs b/corebox/commands/corebox/mod.rs index 42b8b6b..8834748 100644 --- a/corebox/commands/corebox/mod.rs +++ b/corebox/commands/corebox/mod.rs @@ -3,7 +3,7 @@ use clap::Command; use shitbox::Cmd; use std::{error::Error, process}; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Corebox; impl Cmd for Corebox { diff --git a/corebox/commands/cut/mod.rs b/corebox/commands/cut/mod.rs index 58c5ee6..0f5be3e 100644 --- a/corebox/commands/cut/mod.rs +++ b/corebox/commands/cut/mod.rs @@ -8,7 +8,7 @@ use std::{ usize, vec, }; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Cut; impl Cmd for Cut { diff --git a/corebox/commands/df/mod.rs b/corebox/commands/df/mod.rs index f09723c..42e4d21 100644 --- a/corebox/commands/df/mod.rs +++ b/corebox/commands/df/mod.rs @@ -4,7 +4,7 @@ use shitbox::Cmd; use size_display::Size; use std::{error::Error, fmt, io, path::PathBuf}; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Df; impl Cmd for Df { diff --git a/corebox/commands/dirname/mod.rs b/corebox/commands/dirname/mod.rs index 48f56d6..f343ed9 100644 --- a/corebox/commands/dirname/mod.rs +++ b/corebox/commands/dirname/mod.rs @@ -2,7 +2,7 @@ use super::Cmd; use clap::{Arg, ArgAction, Command}; use std::path::Path; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Dirname; impl Cmd for Dirname { diff --git a/corebox/commands/echo/mod.rs b/corebox/commands/echo/mod.rs index 28feae1..a7e5cf5 100644 --- a/corebox/commands/echo/mod.rs +++ b/corebox/commands/echo/mod.rs @@ -2,7 +2,7 @@ use super::Cmd; use clap::{Arg, Command}; use std::{env, error::Error}; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Echo; impl Cmd for Echo { diff --git a/corebox/commands/expand/mod.rs b/corebox/commands/expand/mod.rs index e0a3a8e..e280eb6 100644 --- a/corebox/commands/expand/mod.rs +++ b/corebox/commands/expand/mod.rs @@ -1,7 +1,7 @@ use super::Cmd; use clap::{Arg, ArgAction, Command, ValueHint}; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Expand; impl Cmd for Expand { diff --git a/corebox/commands/factor/mod.rs b/corebox/commands/factor/mod.rs index 9b2a6bb..4822bc3 100644 --- a/corebox/commands/factor/mod.rs +++ b/corebox/commands/factor/mod.rs @@ -5,7 +5,7 @@ use std::{ io::{self, BufRead}, }; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Factor; impl Cmd for Factor { diff --git a/corebox/commands/false/mod.rs b/corebox/commands/false/mod.rs index a3c7d2b..ca52039 100644 --- a/corebox/commands/false/mod.rs +++ b/corebox/commands/false/mod.rs @@ -2,7 +2,7 @@ use super::Cmd; use clap::Command; use std::{error::Error, process}; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct False; impl Cmd for False { diff --git a/corebox/commands/fold/mod.rs b/corebox/commands/fold/mod.rs index 55c25dd..9d0e7ae 100644 --- a/corebox/commands/fold/mod.rs +++ b/corebox/commands/fold/mod.rs @@ -6,7 +6,7 @@ use std::{ }; use textwrap::{fill, wrap_algorithms::WrapAlgorithm}; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Fold; impl Cmd for Fold { diff --git a/corebox/commands/groups/mod.rs b/corebox/commands/groups/mod.rs index 3bc3f31..bc363ba 100644 --- a/corebox/commands/groups/mod.rs +++ b/corebox/commands/groups/mod.rs @@ -1,7 +1,7 @@ use super::Cmd; use clap::{Arg, Command}; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Groups; impl Cmd for Groups { diff --git a/corebox/commands/head/mod.rs b/corebox/commands/head/mod.rs index a047438..fb0e7cd 100644 --- a/corebox/commands/head/mod.rs +++ b/corebox/commands/head/mod.rs @@ -9,7 +9,7 @@ use std::{ }; use termcolor::{Color, ColorChoice, ColorSpec, StandardStream, WriteColor}; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Head; impl Cmd for Head { diff --git a/corebox/commands/hostid/mod.rs b/corebox/commands/hostid/mod.rs index 4a29e3b..22631a4 100644 --- a/corebox/commands/hostid/mod.rs +++ b/corebox/commands/hostid/mod.rs @@ -1,7 +1,7 @@ use super::Cmd; use clap::Command; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Hostid; impl Cmd for Hostid { diff --git a/corebox/commands/hostname/mod.rs b/corebox/commands/hostname/mod.rs index 796586c..3858c2a 100644 --- a/corebox/commands/hostname/mod.rs +++ b/corebox/commands/hostname/mod.rs @@ -2,7 +2,7 @@ use super::Cmd; use clap::{Arg, ArgAction, ArgMatches, Command}; use std::{error::Error, io}; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Hostname; impl Cmd for Hostname { diff --git a/corebox/commands/link/mod.rs b/corebox/commands/link/mod.rs index 5168407..6f8b1c8 100644 --- a/corebox/commands/link/mod.rs +++ b/corebox/commands/link/mod.rs @@ -3,7 +3,7 @@ use clap::{Arg, Command}; use shitbox::args; use std::{fs, io}; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Link; impl Cmd for Link { diff --git a/corebox/commands/ln/mod.rs b/corebox/commands/ln/mod.rs index d94cc56..10ab634 100644 --- a/corebox/commands/ln/mod.rs +++ b/corebox/commands/ln/mod.rs @@ -2,7 +2,7 @@ use super::Cmd; use clap::{Arg, ArgAction, Command}; use std::{error::Error, fs, io, os, path::PathBuf}; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Ln; impl Cmd for Ln { diff --git a/corebox/commands/logname/mod.rs b/corebox/commands/logname/mod.rs index 14be6b8..d1c5888 100644 --- a/corebox/commands/logname/mod.rs +++ b/corebox/commands/logname/mod.rs @@ -3,7 +3,7 @@ use std::ffi::CStr; use super::Cmd; use clap::Command; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Logname; impl Cmd for Logname { diff --git a/corebox/commands/mkfifo/mod.rs b/corebox/commands/mkfifo/mod.rs index d825e4d..676cef9 100644 --- a/corebox/commands/mkfifo/mod.rs +++ b/corebox/commands/mkfifo/mod.rs @@ -4,7 +4,7 @@ use mode::Parser; use shitbox::args; use std::error::Error; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct MkFifo; impl Cmd for MkFifo { diff --git a/corebox/commands/mknod/mod.rs b/corebox/commands/mknod/mod.rs index 4a696d1..fa76163 100644 --- a/corebox/commands/mknod/mod.rs +++ b/corebox/commands/mknod/mod.rs @@ -4,7 +4,7 @@ use mode::{get_umask, Parser}; use shitbox::args; use std::{convert::Infallible, error::Error, io, str::FromStr}; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct MkNod; impl Cmd for MkNod { diff --git a/corebox/commands/mktemp/mod.rs b/corebox/commands/mktemp/mod.rs index e206cb4..fed5939 100644 --- a/corebox/commands/mktemp/mod.rs +++ b/corebox/commands/mktemp/mod.rs @@ -2,7 +2,7 @@ use super::Cmd; use clap::{Arg, ArgAction, Command, ValueHint}; use std::{ffi::CString, fs, io, path::PathBuf}; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct MkTemp; impl Cmd for MkTemp { diff --git a/corebox/commands/mod.rs b/corebox/commands/mod.rs index 0f97d25..1908280 100644 --- a/corebox/commands/mod.rs +++ b/corebox/commands/mod.rs @@ -57,55 +57,54 @@ mod yes; /// Parses a string into a command to run #[must_use] -#[allow(clippy::box_default)] pub fn get(name: &str) -> Option> { match name { - "base64" => Some(Box::new(base64::Base64::default())), - "base32" => Some(Box::new(base32::Base32::default())), - "basename" => Some(Box::new(basename::Basename::default())), - "bootstrap" => Some(Box::new(bootstrap::Bootstrap::default())), - "chmod" => Some(Box::new(chmod::Chmod::default())), - "chgrp" => Some(Box::new(chown::Chgrp::default())), - "chown" => Some(Box::new(chown::Chown::default())), - "chroot" => Some(Box::new(chroot::Chroot::default())), - "corebox" => Some(Box::new(corebox::Corebox::default())), - "cut" => Some(Box::new(cut::Cut::default())), - "df" => Some(Box::new(df::Df::default())), - "dirname" => Some(Box::new(dirname::Dirname::default())), - "echo" => Some(Box::new(echo::Echo::default())), - "factor" => Some(Box::new(factor::Factor::default())), - "false" => Some(Box::new(r#false::False::default())), - "fold" => Some(Box::new(fold::Fold::default())), - "groups" => Some(Box::new(groups::Groups::default())), - "head" => Some(Box::new(head::Head::default())), - "hostid" => Some(Box::new(hostid::Hostid::default())), - "hostname" => Some(Box::new(hostname::Hostname::default())), - "link" => Some(Box::new(link::Link::default())), - "ln" => Some(Box::new(ln::Ln::default())), - "logname" => Some(Box::new(logname::Logname::default())), - "mkfifo" => Some(Box::new(mkfifo::MkFifo::default())), - "mknod" => Some(Box::new(mknod::MkNod::default())), - "mktemp" => Some(Box::new(mktemp::MkTemp::default())), - "nologin" => Some(Box::new(nologin::Nologin::default())), - "nproc" => Some(Box::new(nproc::Nproc::default())), - "printenv" => Some(Box::new(printenv::Printenv::default())), - "pwd" => Some(Box::new(pwd::Pwd::default())), - "readlink" => Some(Box::new(readlink::Readlink::default())), - "realpath" => Some(Box::new(realpath::Realpath::default())), - "rev" => Some(Box::new(rev::Rev::default())), - "rm" => Some(Box::new(rm::Rm::default())), - "rmdir" => Some(Box::new(rmdir::Rmdir::default())), - "sleep" => Some(Box::new(sleep::Sleep::default())), - "sync" => Some(Box::new(sync::Sync::default())), - "touch" => Some(Box::new(touch::Touch::default())), - "true" => Some(Box::new(r#true::True::default())), + "base64" => Some(Box::new(base64::Base64)), + "base32" => Some(Box::new(base32::Base32)), + "basename" => Some(Box::new(basename::Basename)), + "bootstrap" => Some(Box::new(bootstrap::Bootstrap)), + "chmod" => Some(Box::new(chmod::Chmod)), + "chgrp" => Some(Box::new(chown::Chgrp)), + "chown" => Some(Box::new(chown::Chown)), + "chroot" => Some(Box::new(chroot::Chroot)), + "corebox" => Some(Box::new(corebox::Corebox)), + "cut" => Some(Box::new(cut::Cut)), + "df" => Some(Box::new(df::Df)), + "dirname" => Some(Box::new(dirname::Dirname)), + "echo" => Some(Box::new(echo::Echo)), + "factor" => Some(Box::new(factor::Factor)), + "false" => Some(Box::new(r#false::False)), + "fold" => Some(Box::new(fold::Fold)), + "groups" => Some(Box::new(groups::Groups)), + "head" => Some(Box::new(head::Head)), + "hostid" => Some(Box::new(hostid::Hostid)), + "hostname" => Some(Box::new(hostname::Hostname)), + "link" => Some(Box::new(link::Link)), + "ln" => Some(Box::new(ln::Ln)), + "logname" => Some(Box::new(logname::Logname)), + "mkfifo" => Some(Box::new(mkfifo::MkFifo)), + "mknod" => Some(Box::new(mknod::MkNod)), + "mktemp" => Some(Box::new(mktemp::MkTemp)), + "nologin" => Some(Box::new(nologin::Nologin)), + "nproc" => Some(Box::new(nproc::Nproc)), + "printenv" => Some(Box::new(printenv::Printenv)), + "pwd" => Some(Box::new(pwd::Pwd)), + "readlink" => Some(Box::new(readlink::Readlink)), + "realpath" => Some(Box::new(realpath::Realpath)), + "rev" => Some(Box::new(rev::Rev)), + "rm" => Some(Box::new(rm::Rm)), + "rmdir" => Some(Box::new(rmdir::Rmdir)), + "sleep" => Some(Box::new(sleep::Sleep)), + "sync" => Some(Box::new(sync::Sync)), + "touch" => Some(Box::new(touch::Touch)), + "true" => Some(Box::new(r#true::True)), "truncate" => Some(Box::new(truncate::Truncate)), - "unlink" => Some(Box::new(unlink::Unlink::default())), - "wc" => Some(Box::new(wc::Wc::default())), - "which" => Some(Box::new(which::Which::default())), - "who" => Some(Box::new(who::Who::default())), - "whoami" => Some(Box::new(whoami::Whoami::default())), - "yes" => Some(Box::new(yes::Yes::default())), + "unlink" => Some(Box::new(unlink::Unlink)), + "wc" => Some(Box::new(wc::Wc)), + "which" => Some(Box::new(which::Which)), + "who" => Some(Box::new(who::Who)), + "whoami" => Some(Box::new(whoami::Whoami)), + "yes" => Some(Box::new(yes::Yes)), _ => None, } } diff --git a/corebox/commands/nologin/mod.rs b/corebox/commands/nologin/mod.rs index 921a2c6..27a22ca 100644 --- a/corebox/commands/nologin/mod.rs +++ b/corebox/commands/nologin/mod.rs @@ -2,7 +2,7 @@ use super::Cmd; use clap::Command; use std::process; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Nologin; impl Cmd for Nologin { diff --git a/corebox/commands/nproc/mod.rs b/corebox/commands/nproc/mod.rs index e91280d..7586fca 100644 --- a/corebox/commands/nproc/mod.rs +++ b/corebox/commands/nproc/mod.rs @@ -1,7 +1,7 @@ use super::Cmd; use clap::{Arg, ArgAction, Command}; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Nproc; impl Cmd for Nproc { diff --git a/corebox/commands/printenv/mod.rs b/corebox/commands/printenv/mod.rs index 5cfe795..30a36ac 100644 --- a/corebox/commands/printenv/mod.rs +++ b/corebox/commands/printenv/mod.rs @@ -3,7 +3,7 @@ use std::env; use super::Cmd; use clap::{Arg, ArgAction, Command}; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Printenv; impl Cmd for Printenv { diff --git a/corebox/commands/pwd/mod.rs b/corebox/commands/pwd/mod.rs index 9b09f9b..8ab5961 100644 --- a/corebox/commands/pwd/mod.rs +++ b/corebox/commands/pwd/mod.rs @@ -2,7 +2,7 @@ use super::Cmd; use clap::{Arg, ArgAction, Command}; use std::{env, path::PathBuf}; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Pwd; impl Cmd for Pwd { diff --git a/corebox/commands/readlink/mod.rs b/corebox/commands/readlink/mod.rs index 2e4f65c..7c57713 100644 --- a/corebox/commands/readlink/mod.rs +++ b/corebox/commands/readlink/mod.rs @@ -2,7 +2,7 @@ use clap::{Arg, ArgAction, ArgMatches, Command, ValueHint}; use shitbox::Cmd; use std::{fs, path::PathBuf}; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Readlink; impl Cmd for Readlink { diff --git a/corebox/commands/realpath/mod.rs b/corebox/commands/realpath/mod.rs index 9c4d5fd..547c918 100644 --- a/corebox/commands/realpath/mod.rs +++ b/corebox/commands/realpath/mod.rs @@ -2,7 +2,7 @@ use super::Cmd; use clap::{Arg, ArgAction, Command, ValueHint}; use std::{env, fs, process}; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Realpath; impl Cmd for Realpath { diff --git a/corebox/commands/rev/mod.rs b/corebox/commands/rev/mod.rs index c5245c1..23be2c6 100644 --- a/corebox/commands/rev/mod.rs +++ b/corebox/commands/rev/mod.rs @@ -7,7 +7,7 @@ use std::{ }; use termcolor::{Color, ColorChoice, ColorSpec, StandardStream, WriteColor}; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Rev; impl Cmd for Rev { diff --git a/corebox/commands/rm/mod.rs b/corebox/commands/rm/mod.rs index 5da4582..020b317 100644 --- a/corebox/commands/rm/mod.rs +++ b/corebox/commands/rm/mod.rs @@ -10,7 +10,7 @@ use std::{ str::FromStr, }; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Rm; impl Cmd for Rm { diff --git a/corebox/commands/rmdir/mod.rs b/corebox/commands/rmdir/mod.rs index 33eb32f..8f7d19f 100644 --- a/corebox/commands/rmdir/mod.rs +++ b/corebox/commands/rmdir/mod.rs @@ -3,7 +3,7 @@ use clap::{Arg, ArgAction, Command, ValueHint}; use shitbox::args; use std::{error::Error, fs, path::Path}; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Rmdir; impl Cmd for Rmdir { diff --git a/corebox/commands/sleep/mod.rs b/corebox/commands/sleep/mod.rs index 2312ca5..ec60b6e 100644 --- a/corebox/commands/sleep/mod.rs +++ b/corebox/commands/sleep/mod.rs @@ -2,7 +2,7 @@ use super::Cmd; use clap::{value_parser, Arg, ArgAction, ArgMatches, Command}; use std::{env, error::Error, thread, time::Duration}; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Sleep; impl Cmd for Sleep { diff --git a/corebox/commands/sync/mod.rs b/corebox/commands/sync/mod.rs index 9aa20c4..f135168 100644 --- a/corebox/commands/sync/mod.rs +++ b/corebox/commands/sync/mod.rs @@ -2,7 +2,7 @@ use super::Cmd; use clap::{Arg, ArgAction, Command}; use std::{error::Error, fs::OpenOptions}; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Sync; impl Cmd for Sync { diff --git a/corebox/commands/touch/mod.rs b/corebox/commands/touch/mod.rs index bbe83a5..63289fd 100644 --- a/corebox/commands/touch/mod.rs +++ b/corebox/commands/touch/mod.rs @@ -4,7 +4,7 @@ use filetime::*; use shitbox::Cmd; use std::{error::Error, fs::File, io, path::PathBuf}; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Touch; impl Cmd for Touch { diff --git a/corebox/commands/true/mod.rs b/corebox/commands/true/mod.rs index 200e4ff..f0a0d27 100644 --- a/corebox/commands/true/mod.rs +++ b/corebox/commands/true/mod.rs @@ -2,7 +2,7 @@ use super::Cmd; use clap::Command; use std::{error::Error, process}; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct True; impl Cmd for True { diff --git a/corebox/commands/truncate/mod.rs b/corebox/commands/truncate/mod.rs index 1d09801..0c55903 100644 --- a/corebox/commands/truncate/mod.rs +++ b/corebox/commands/truncate/mod.rs @@ -4,7 +4,7 @@ use { std::{error::Error, fmt, fs::{self, File}, num::ParseIntError, path::PathBuf}, }; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Truncate; impl Cmd for Truncate { diff --git a/corebox/commands/unlink/mod.rs b/corebox/commands/unlink/mod.rs index ff9cc50..0ba8c81 100644 --- a/corebox/commands/unlink/mod.rs +++ b/corebox/commands/unlink/mod.rs @@ -2,7 +2,7 @@ use super::Cmd; use clap::{Arg, Command}; use shitbox::args; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Unlink; impl Cmd for Unlink { diff --git a/corebox/commands/wc/mod.rs b/corebox/commands/wc/mod.rs index b8e5c8a..601c879 100644 --- a/corebox/commands/wc/mod.rs +++ b/corebox/commands/wc/mod.rs @@ -11,7 +11,7 @@ use std::{ str::FromStr, }; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Wc; impl Cmd for Wc { diff --git a/corebox/commands/which/mod.rs b/corebox/commands/which/mod.rs index cb55201..057da4a 100644 --- a/corebox/commands/which/mod.rs +++ b/corebox/commands/which/mod.rs @@ -4,7 +4,7 @@ use clap::{Arg, Command}; use mode::Bit; use std::{env, fs::File, os::unix::prelude::MetadataExt, path::PathBuf, process}; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Which; impl Cmd for Which { diff --git a/corebox/commands/who/mod.rs b/corebox/commands/who/mod.rs index 8d01dd1..a4e04df 100644 --- a/corebox/commands/who/mod.rs +++ b/corebox/commands/who/mod.rs @@ -2,7 +2,7 @@ use clap::{Arg, ArgAction, Command}; use shitbox::Cmd; use utmp_rs::UtmpEntry; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Who; impl Cmd for Who { diff --git a/corebox/commands/whoami/mod.rs b/corebox/commands/whoami/mod.rs index fec3169..f82e50b 100644 --- a/corebox/commands/whoami/mod.rs +++ b/corebox/commands/whoami/mod.rs @@ -5,7 +5,7 @@ use { std::ffi::CStr, }; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Whoami; impl Cmd for Whoami { diff --git a/corebox/commands/yes/mod.rs b/corebox/commands/yes/mod.rs index ec62de3..eac462c 100644 --- a/corebox/commands/yes/mod.rs +++ b/corebox/commands/yes/mod.rs @@ -1,7 +1,7 @@ use super::Cmd; use clap::{Arg, Command}; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Yes; impl Cmd for Yes { diff --git a/hashbox/commands/mod.rs b/hashbox/commands/mod.rs index 9e1cb15..a827a05 100644 --- a/hashbox/commands/mod.rs +++ b/hashbox/commands/mod.rs @@ -12,18 +12,17 @@ mod sha512sum; /// Parses a string into a command to run #[must_use] -#[allow(clippy::box_default)] pub fn get(name: &str) -> Option> { match name { - "b2sum" => Some(Box::new(b2sum::B2sum::default())), - "bootstrap" => Some(Box::new(bootstrap::Bootstrap::default())), - "hashbox" => Some(Box::new(hashbox::Hashbox::default())), - "md5sum" => Some(Box::new(md5sum::Md5sum::default())), - "sha1sum" => Some(Box::new(sha1sum::Sha1sum::default())), - "sha224sum" => Some(Box::new(sha224sum::Sha224sum::default())), - "sha256sum" => Some(Box::new(sha256sum::Sha256sum::default())), - "sha384sum" => Some(Box::new(sha384sum::Sha384sum::default())), - "sha512sum" => Some(Box::new(sha512sum::Sha512sum::default())), + "b2sum" => Some(Box::new(b2sum::B2sum)), + "bootstrap" => Some(Box::new(bootstrap::Bootstrap)), + "hashbox" => Some(Box::new(hashbox::Hashbox)), + "md5sum" => Some(Box::new(md5sum::Md5sum)), + "sha1sum" => Some(Box::new(sha1sum::Sha1sum)), + "sha224sum" => Some(Box::new(sha224sum::Sha224sum)), + "sha256sum" => Some(Box::new(sha256sum::Sha256sum)), + "sha384sum" => Some(Box::new(sha384sum::Sha384sum)), + "sha512sum" => Some(Box::new(sha512sum::Sha512sum)), _ => None, } } diff --git a/src/cmd/mod.rs b/src/cmd/mod.rs index 27814e6..017d48b 100644 --- a/src/cmd/mod.rs +++ b/src/cmd/mod.rs @@ -1,9 +1,9 @@ use clap::ArgMatches; -use std::{error::Error, fmt}; +use std::error::Error; /// Defines a command or applet, it's cli interface, and it's installation directory /// relative to the binary -pub trait Cmd: fmt::Debug + Sync { +pub trait Cmd: Sync { /// Defines the cli of the applet fn cli(&self) -> clap::Command; /// Runs the applet diff --git a/utilbox/commands/bootstrap/mod.rs b/utilbox/commands/bootstrap/mod.rs index 3f688ef..caa9d7b 100644 --- a/utilbox/commands/bootstrap/mod.rs +++ b/utilbox/commands/bootstrap/mod.rs @@ -10,7 +10,7 @@ use std::{ path::{Path, PathBuf}, }; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Bootstrap; impl Bootstrap { diff --git a/utilbox/commands/clear/mod.rs b/utilbox/commands/clear/mod.rs index eb1dfe8..10fe17b 100644 --- a/utilbox/commands/clear/mod.rs +++ b/utilbox/commands/clear/mod.rs @@ -1,7 +1,7 @@ use super::Cmd; use clap::Command; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Clear; impl Cmd for Clear { diff --git a/utilbox/commands/mod.rs b/utilbox/commands/mod.rs index 89ab2ff..d12ed1a 100644 --- a/utilbox/commands/mod.rs +++ b/utilbox/commands/mod.rs @@ -13,16 +13,15 @@ mod utilbox; /// Parses a string into a command to run #[must_use] -#[allow(clippy::box_default)] pub fn get(name: &str) -> Option> { match name { - "bootstrap" => Some(Box::new(bootstrap::Bootstrap::default())), - "clear" => Some(Box::new(clear::Clear::default())), - "mountpoint" => Some(Box::new(mountpoint::Mountpoint::default())), - "swaplabel" => Some(Box::new(swaplabel::Swaplabel::default())), - "swapoff" => Some(Box::new(swapoff::Swapoff::default())), - "umount" => Some(Box::new(umount::Umount::default())), - "utilbox" => Some(Box::new(utilbox::Utilbox::default())), + "bootstrap" => Some(Box::new(bootstrap::Bootstrap)), + "clear" => Some(Box::new(clear::Clear)), + "mountpoint" => Some(Box::new(mountpoint::Mountpoint)), + "swaplabel" => Some(Box::new(swaplabel::Swaplabel)), + "swapoff" => Some(Box::new(swapoff::Swapoff)), + "umount" => Some(Box::new(umount::Umount)), + "utilbox" => Some(Box::new(utilbox::Utilbox)), _ => None, } } diff --git a/utilbox/commands/mount/mod.rs b/utilbox/commands/mount/mod.rs index d525413..34ac4b6 100644 --- a/utilbox/commands/mount/mod.rs +++ b/utilbox/commands/mount/mod.rs @@ -1,7 +1,7 @@ use clap::{ArgMatches, Command}; use shitbox::Cmd; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Mount; impl Cmd for Mount { diff --git a/utilbox/commands/mountpoint/mod.rs b/utilbox/commands/mountpoint/mod.rs index 1c78b5e..b372845 100644 --- a/utilbox/commands/mountpoint/mod.rs +++ b/utilbox/commands/mountpoint/mod.rs @@ -9,7 +9,7 @@ use std::{ process, }; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Mountpoint; impl Cmd for Mountpoint { diff --git a/utilbox/commands/swaplabel/mod.rs b/utilbox/commands/swaplabel/mod.rs index fbd817b..6f924b0 100644 --- a/utilbox/commands/swaplabel/mod.rs +++ b/utilbox/commands/swaplabel/mod.rs @@ -19,7 +19,7 @@ lazy_static! { unsafe { libc::sysconf(libc::_SC_PAGESIZE) as u64 - SWAP_MAGIC_LENGTH }; } -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Swaplabel; impl Cmd for Swaplabel { diff --git a/utilbox/commands/swapoff/mod.rs b/utilbox/commands/swapoff/mod.rs index d6173f2..a1839d5 100644 --- a/utilbox/commands/swapoff/mod.rs +++ b/utilbox/commands/swapoff/mod.rs @@ -6,7 +6,7 @@ use std::{ io::{self, BufRead, BufReader}, }; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Swapoff; impl Cmd for Swapoff { diff --git a/utilbox/commands/umount/mod.rs b/utilbox/commands/umount/mod.rs index eb24591..defcf17 100644 --- a/utilbox/commands/umount/mod.rs +++ b/utilbox/commands/umount/mod.rs @@ -3,7 +3,7 @@ use mount::MntEntries; use shitbox::{args, Cmd}; use std::io; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Umount; impl Cmd for Umount { diff --git a/utilbox/commands/utilbox/mod.rs b/utilbox/commands/utilbox/mod.rs index a543b08..8cb5f51 100644 --- a/utilbox/commands/utilbox/mod.rs +++ b/utilbox/commands/utilbox/mod.rs @@ -3,7 +3,7 @@ use clap::Command; use shitbox::Cmd; use std::{error::Error, process}; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct Utilbox; impl Cmd for Utilbox {