1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-04 15:07:47 +00:00

refactor/polish ~ fix cargo clippy complaints (Vec<> => [])

This commit is contained in:
Roy Ivy III 2019-12-28 12:01:52 -06:00
parent ec5ca193ac
commit a72422fb0e
2 changed files with 3 additions and 3 deletions

View file

@ -336,14 +336,14 @@ fn display_dir_entry_size(entry: &PathBuf, options: &getopts::Matches) -> (usize
fn pad_left(string: String, count: usize) -> String { fn pad_left(string: String, count: usize) -> String {
if count > string.len() { if count > string.len() {
let pad = count - string.len(); let pad = count - string.len();
let pad = String::from_utf8(vec![b' ' as u8; pad]).unwrap(); let pad = String::from_utf8(vec![b' '; pad]).unwrap();
format!("{}{}", pad, string) format!("{}{}", pad, string)
} else { } else {
string string
} }
} }
fn display_items(items: &Vec<PathBuf>, strip: Option<&Path>, options: &getopts::Matches) { fn display_items(items: &[PathBuf], strip: Option<&Path>, options: &getopts::Matches) {
if options.opt_present("long") || options.opt_present("numeric-uid-gid") { if options.opt_present("long") || options.opt_present("numeric-uid-gid") {
let (mut max_links, mut max_size) = (1, 1); let (mut max_links, mut max_size) = (1, 1);
for item in items { for item in items {

View file

@ -478,7 +478,7 @@ fn print_bytes(prefix: &str, input_decoder: &MemoryDecoder, output_info: &Output
/// `skip_bytes` is the number of bytes skipped from the input /// `skip_bytes` is the number of bytes skipped from the input
/// `read_bytes` is an optional limit to the number of bytes to read /// `read_bytes` is an optional limit to the number of bytes to read
fn open_input_peek_reader<'a>( fn open_input_peek_reader<'a>(
input_strings: &'a Vec<String>, input_strings: &'a [String],
skip_bytes: usize, skip_bytes: usize,
read_bytes: Option<usize>, read_bytes: Option<usize>,
) -> PeekReader<PartialReader<MultifileReader<'a>>> { ) -> PeekReader<PartialReader<MultifileReader<'a>>> {