1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 11:07:44 +00:00

chores: run cargo +1.40.0 fmt

Apparently fmt from 1.40.0 is a bit more strict in some places

Let me know if this is worthwhile merging :)
This commit is contained in:
ReggaeMuffin 2021-04-02 10:56:49 +01:00
parent de6aa69259
commit 2eb32d845e
No known key found for this signature in database
GPG key ID: B7A56D7FE881B7C5
13 changed files with 94 additions and 95 deletions

2
Cargo.lock generated
View file

@ -2181,7 +2181,7 @@ dependencies = [
name = "uu_relpath" name = "uu_relpath"
version = "0.0.4" version = "0.0.4"
dependencies = [ dependencies = [
"getopts", "clap",
"uucore", "uucore",
"uucore_procs", "uucore_procs",
] ]

View file

@ -223,40 +223,40 @@ fn get_usage() -> String {
static AFTER_HELP: &str = static AFTER_HELP: &str =
"Delete FILE(s) if --remove (-u) is specified. The default is not to remove\n\ "Delete FILE(s) if --remove (-u) is specified. The default is not to remove\n\
the files because it is common to operate on device files like /dev/hda,\n\ the files because it is common to operate on device files like /dev/hda,\n\
and those files usually should not be removed.\n\ and those files usually should not be removed.\n\
\n\ \n\
CAUTION: Note that shred relies on a very important assumption:\n\ CAUTION: Note that shred relies on a very important assumption:\n\
that the file system overwrites data in place. This is the traditional\n\ that the file system overwrites data in place. This is the traditional\n\
way to do things, but many modern file system designs do not satisfy this\n\ way to do things, but many modern file system designs do not satisfy this\n\
assumption. The following are examples of file systems on which shred is\n\ assumption. The following are examples of file systems on which shred is\n\
not effective, or is not guaranteed to be effective in all file system modes:\n\ not effective, or is not guaranteed to be effective in all file system modes:\n\
\n\ \n\
* log-structured or journaled file systems, such as those supplied with\n\ * log-structured or journaled file systems, such as those supplied with\n\
AIX and Solaris (and JFS, ReiserFS, XFS, Ext3, etc.)\n\ AIX and Solaris (and JFS, ReiserFS, XFS, Ext3, etc.)\n\
\n\ \n\
* file systems that write redundant data and carry on even if some writes\n\ * file systems that write redundant data and carry on even if some writes\n\
fail, such as RAID-based file systems\n\ fail, such as RAID-based file systems\n\
\n\ \n\
* file systems that make snapshots, such as Network Appliance's NFS server\n\ * file systems that make snapshots, such as Network Appliance's NFS server\n\
\n\ \n\
* file systems that cache in temporary locations, such as NFS\n\ * file systems that cache in temporary locations, such as NFS\n\
version 3 clients\n\ version 3 clients\n\
\n\ \n\
* compressed file systems\n\ * compressed file systems\n\
\n\ \n\
In the case of ext3 file systems, the above disclaimer applies\n\ In the case of ext3 file systems, the above disclaimer applies\n\
and shred is thus of limited effectiveness) only in data=journal mode,\n\ and shred is thus of limited effectiveness) only in data=journal mode,\n\
which journals file data in addition to just metadata. In both the\n\ which journals file data in addition to just metadata. In both the\n\
data=ordered (default) and data=writeback modes, shred works as usual.\n\ data=ordered (default) and data=writeback modes, shred works as usual.\n\
Ext3 journaling modes can be changed by adding the data=something option\n\ Ext3 journaling modes can be changed by adding the data=something option\n\
to the mount options for a particular file system in the /etc/fstab file,\n\ to the mount options for a particular file system in the /etc/fstab file,\n\
as documented in the mount man page (man mount).\n\ as documented in the mount man page (man mount).\n\
\n\ \n\
In addition, file system backups and remote mirrors may contain copies\n\ In addition, file system backups and remote mirrors may contain copies\n\
of the file that cannot be removed, and that will allow a shredded file\n\ of the file that cannot be removed, and that will allow a shredded file\n\
to be recovered later.\n\ to be recovered later.\n\
"; ";
pub mod options { pub mod options {
pub const FILE: &str = "file"; pub const FILE: &str = "file";
@ -312,7 +312,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
.short("x") .short("x")
.help( .help(
"do not round file sizes up to the next full block;\n\ "do not round file sizes up to the next full block;\n\
this is the default for non-regular files", this is the default for non-regular files",
), ),
) )
.arg( .arg(

View file

@ -80,7 +80,8 @@ fn print_version() {
fn print_usage(opts: &Options) { fn print_usage(opts: &Options) {
let brief = "Run COMMAND, with modified buffering operations for its standard streams\n \ let brief = "Run COMMAND, with modified buffering operations for its standard streams\n \
Mandatory arguments to long options are mandatory for short options too."; Mandatory arguments to long options are mandatory for short options too.";
let explanation = "If MODE is 'L' the corresponding stream will be line buffered.\n \ let explanation =
"If MODE is 'L' the corresponding stream will be line buffered.\n \
This option is invalid with standard input.\n\n \ This option is invalid with standard input.\n\n \
If MODE is '0' the corresponding stream will be unbuffered.\n\n \ If MODE is '0' the corresponding stream will be unbuffered.\n\n \
Otherwise MODE is a number which may be followed by one of the following:\n\n \ Otherwise MODE is a number which may be followed by one of the following:\n\n \

View file

@ -19,8 +19,8 @@ use uucore::libc::time_t;
static VERSION: &str = env!("CARGO_PKG_VERSION"); static VERSION: &str = env!("CARGO_PKG_VERSION");
static ABOUT: &str = "Display the current time, the length of time the system has been up,\n\ static ABOUT: &str = "Display the current time, the length of time the system has been up,\n\
the number of users on the system, and the average number of jobs\n\ the number of users on the system, and the average number of jobs\n\
in the run queue over the last 1, 5 and 15 minutes."; in the run queue over the last 1, 5 and 15 minutes.";
pub mod options { pub mod options {
pub static SINCE: &str = "since"; pub static SINCE: &str = "since";
} }

View file

@ -135,9 +135,7 @@ impl CmdResult {
pub fn tmpd(&self) -> Rc<TempDir> { pub fn tmpd(&self) -> Rc<TempDir> {
match &self.tmpd { match &self.tmpd {
Some(ptr) => ptr.clone(), Some(ptr) => ptr.clone(),
None => { None => panic!("Command not associated with a TempDir"),
panic!("Command not associated with a TempDir")
}
} }
} }