mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 12:37:49 +00:00
Ran rustfmt
This commit is contained in:
parent
6654519c7d
commit
c01c6a7d78
2 changed files with 23 additions and 30 deletions
|
@ -233,14 +233,13 @@ where
|
||||||
//
|
//
|
||||||
const MINIMUM_READBACK_BUFFER: u64 = 8200;
|
const MINIMUM_READBACK_BUFFER: u64 = 8200;
|
||||||
let right_sized_buffer = adjusted_buffer_size
|
let right_sized_buffer = adjusted_buffer_size
|
||||||
.checked_div(iter.chunks)
|
.checked_div(iter.chunks)
|
||||||
.unwrap_or(adjusted_buffer_size);
|
.unwrap_or(adjusted_buffer_size);
|
||||||
iter.max_per_chunk =
|
iter.max_per_chunk = if right_sized_buffer > MINIMUM_READBACK_BUFFER {
|
||||||
if right_sized_buffer > MINIMUM_READBACK_BUFFER {
|
right_sized_buffer
|
||||||
right_sized_buffer
|
} else {
|
||||||
} else {
|
MINIMUM_READBACK_BUFFER
|
||||||
MINIMUM_READBACK_BUFFER
|
};
|
||||||
};
|
|
||||||
iter.buffers = vec![VecDeque::new(); iter.chunks as usize];
|
iter.buffers = vec![VecDeque::new(); iter.chunks as usize];
|
||||||
iter.chunk_offsets = vec![0 as u64; iter.chunks as usize];
|
iter.chunk_offsets = vec![0 as u64; iter.chunks as usize];
|
||||||
for chunk_num in 0..iter.chunks {
|
for chunk_num in 0..iter.chunks {
|
||||||
|
|
|
@ -92,17 +92,12 @@ static THOUSANDS_SEP: char = ',';
|
||||||
static NEGATIVE: char = '-';
|
static NEGATIVE: char = '-';
|
||||||
static POSITIVE: char = '+';
|
static POSITIVE: char = '+';
|
||||||
|
|
||||||
#[cfg(any(
|
#[cfg(any(target_os = "windows",))]
|
||||||
target_os = "windows",
|
|
||||||
))]
|
|
||||||
static DEFAULT_TMPDIR: &str = r"%USERPROFILE%\AppData\Local\Temp";
|
static DEFAULT_TMPDIR: &str = r"%USERPROFILE%\AppData\Local\Temp";
|
||||||
|
|
||||||
#[cfg(not(any(
|
#[cfg(not(any(target_os = "windows",)))]
|
||||||
target_os = "windows",
|
|
||||||
)))]
|
|
||||||
static DEFAULT_TMPDIR: &str = r"/tmp";
|
static DEFAULT_TMPDIR: &str = r"/tmp";
|
||||||
|
|
||||||
|
|
||||||
static DEFAULT_BUF_SIZE: usize = usize::MAX;
|
static DEFAULT_BUF_SIZE: usize = usize::MAX;
|
||||||
|
|
||||||
#[derive(Eq, Ord, PartialEq, PartialOrd, Clone, Copy)]
|
#[derive(Eq, Ord, PartialEq, PartialOrd, Clone, Copy)]
|
||||||
|
@ -1074,8 +1069,8 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||||
} else {
|
} else {
|
||||||
for (key, value) in env::vars_os() {
|
for (key, value) in env::vars_os() {
|
||||||
if key == OsString::from("TMPDIR")
|
if key == OsString::from("TMPDIR")
|
||||||
|| key == OsString::from("TEMP")
|
|| key == OsString::from("TEMP")
|
||||||
|| key == OsString::from("TMP")
|
|| key == OsString::from("TMP")
|
||||||
{
|
{
|
||||||
settings.tmp_dir = PathBuf::from(value);
|
settings.tmp_dir = PathBuf::from(value);
|
||||||
break;
|
break;
|
||||||
|
@ -1311,11 +1306,10 @@ fn compare_by(a: &Line, b: &Line, global_settings: &GlobalSettings) -> Ordering
|
||||||
(a_str, a_selection.num_cache.as_num_info()),
|
(a_str, a_selection.num_cache.as_num_info()),
|
||||||
(b_str, b_selection.num_cache.as_num_info()),
|
(b_str, b_selection.num_cache.as_num_info()),
|
||||||
),
|
),
|
||||||
SortMode::GeneralNumeric => {
|
SortMode::GeneralNumeric => general_numeric_compare(
|
||||||
general_numeric_compare(
|
general_f64_parse(&a_str[get_leading_gen(a_str)]),
|
||||||
general_f64_parse(&a_str[get_leading_gen(a_str)]),
|
general_f64_parse(&b_str[get_leading_gen(b_str)]),
|
||||||
general_f64_parse(&b_str[get_leading_gen(b_str)]),)
|
),
|
||||||
}
|
|
||||||
SortMode::Month => month_compare(a_str, b_str),
|
SortMode::Month => month_compare(a_str, b_str),
|
||||||
SortMode::Version => version_compare(a_str, b_str),
|
SortMode::Version => version_compare(a_str, b_str),
|
||||||
SortMode::Default => default_compare(a_str, b_str),
|
SortMode::Default => default_compare(a_str, b_str),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue