mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 19:47:45 +00:00
rustfmt the recent change
This commit is contained in:
parent
70e65c419f
commit
4aaeede3d8
7 changed files with 24 additions and 35 deletions
|
@ -223,9 +223,7 @@ fn read_to_buffer(
|
||||||
Err(e) if e.kind() == ErrorKind::Interrupted => {
|
Err(e) if e.kind() == ErrorKind::Interrupted => {
|
||||||
// retry
|
// retry
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => crash!(1, "{}", e),
|
||||||
crash!(1, "{}", e)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -505,9 +505,7 @@ impl KeyPosition {
|
||||||
'R' => settings.random = true,
|
'R' => settings.random = true,
|
||||||
'r' => settings.reverse = true,
|
'r' => settings.reverse = true,
|
||||||
'V' => settings.mode = SortMode::Version,
|
'V' => settings.mode = SortMode::Version,
|
||||||
c => {
|
c => crash!(1, "invalid option for key: `{}`", c),
|
||||||
crash!(1, "invalid option for key: `{}`", c)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// All numeric sorts and month sort conflict with dictionary_order and ignore_non_printing.
|
// All numeric sorts and month sort conflict with dictionary_order and ignore_non_printing.
|
||||||
// Instad of reporting an error, let them overwrite each other.
|
// Instad of reporting an error, let them overwrite each other.
|
||||||
|
|
|
@ -25,7 +25,8 @@ static VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||||
static ABOUT: &str =
|
static ABOUT: &str =
|
||||||
"Run COMMAND, with modified buffering operations for its standard streams.\n\n\
|
"Run COMMAND, with modified buffering operations for its standard streams.\n\n\
|
||||||
Mandatory arguments to long options are mandatory for short options too.";
|
Mandatory arguments to long options are mandatory for short options too.";
|
||||||
static LONG_HELP: &str = "If MODE is 'L' the corresponding stream will be line buffered.\n\
|
static LONG_HELP: &str =
|
||||||
|
"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\
|
||||||
|
|
|
@ -349,7 +349,6 @@ fn test_sleep_interval() {
|
||||||
new_ucmd!().arg("-s").arg("10").arg(FOOBAR_TXT).succeeds();
|
new_ucmd!().arg("-s").arg("10").arg(FOOBAR_TXT).succeeds();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Test for reading all but the first NUM bytes: `tail -c +3`.
|
/// Test for reading all but the first NUM bytes: `tail -c +3`.
|
||||||
#[test]
|
#[test]
|
||||||
fn test_positive_bytes() {
|
fn test_positive_bytes() {
|
||||||
|
@ -360,7 +359,6 @@ fn test_positive_bytes() {
|
||||||
.stdout_is("cde");
|
.stdout_is("cde");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Test for reading all bytes, specified by `tail -c +0`.
|
/// Test for reading all bytes, specified by `tail -c +0`.
|
||||||
#[test]
|
#[test]
|
||||||
fn test_positive_zero_bytes() {
|
fn test_positive_zero_bytes() {
|
||||||
|
@ -371,7 +369,6 @@ fn test_positive_zero_bytes() {
|
||||||
.stdout_is("abcde");
|
.stdout_is("abcde");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Test for reading all but the first NUM lines: `tail -n +3`.
|
/// Test for reading all but the first NUM lines: `tail -n +3`.
|
||||||
#[test]
|
#[test]
|
||||||
fn test_positive_lines() {
|
fn test_positive_lines() {
|
||||||
|
@ -382,7 +379,6 @@ fn test_positive_lines() {
|
||||||
.stdout_is("c\nd\ne\n");
|
.stdout_is("c\nd\ne\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Test for reading all lines, specified by `tail -n +0`.
|
/// Test for reading all lines, specified by `tail -n +0`.
|
||||||
#[test]
|
#[test]
|
||||||
fn test_positive_zero_lines() {
|
fn test_positive_zero_lines() {
|
||||||
|
|
|
@ -97,13 +97,9 @@ fn test_runlevel() {
|
||||||
#[cfg(any(target_vendor = "apple", target_os = "freebsd"))]
|
#[cfg(any(target_vendor = "apple", target_os = "freebsd"))]
|
||||||
#[test]
|
#[test]
|
||||||
fn test_runlevel() {
|
fn test_runlevel() {
|
||||||
let expected =
|
let expected = "error: Found argument";
|
||||||
"error: Found argument";
|
|
||||||
for opt in vec!["-r", "--runlevel"] {
|
for opt in vec!["-r", "--runlevel"] {
|
||||||
new_ucmd!()
|
new_ucmd!().arg(opt).fails().stderr_contains(expected);
|
||||||
.arg(opt)
|
|
||||||
.fails()
|
|
||||||
.stderr_contains(expected);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue