1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 12:07:46 +00:00

ls: deleting user defined max function (#1591)

This is trivial refactor.
```usize``` can call max method, so deleting user defined max function.
This commit is contained in:
16yuki0702 2020-08-26 16:42:27 +09:00 committed by GitHub
parent e7a1d13380
commit 19e967ef31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -271,14 +271,6 @@ fn sort_entries(entries: &mut Vec<PathBuf>, options: &getopts::Matches) {
}
}
fn max(lhs: usize, rhs: usize) -> usize {
if lhs > rhs {
lhs
} else {
rhs
}
}
fn should_display(entry: &DirEntry, options: &getopts::Matches) -> bool {
let ffi_name = entry.file_name();
let name = ffi_name.to_string_lossy();
@ -350,8 +342,8 @@ fn display_items(items: &[PathBuf], strip: Option<&Path>, options: &getopts::Mat
let (mut max_links, mut max_size) = (1, 1);
for item in items {
let (links, size) = display_dir_entry_size(item, options);
max_links = max(links, max_links);
max_size = max(size, max_size);
max_links = links.max(max_links);
max_size = size.max(max_size);
}
for item in items {
display_item_long(item, strip, max_links, max_size, options);