mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-09-16 11:46:17 +00:00
refactor/pr ~ fix cargo clippy
complaint (clippy::needless_borrow)
This commit is contained in:
parent
f7028c4175
commit
ad486a77dc
1 changed files with 4 additions and 4 deletions
|
@ -410,7 +410,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||||
let options = &result_options.unwrap();
|
let options = &result_options.unwrap();
|
||||||
|
|
||||||
let cmd_result = if file_group.len() == 1 {
|
let cmd_result = if file_group.len() == 1 {
|
||||||
pr(&file_group.get(0).unwrap(), options)
|
pr(file_group.get(0).unwrap(), options)
|
||||||
} else {
|
} else {
|
||||||
mpr(&file_group, options)
|
mpr(&file_group, options)
|
||||||
};
|
};
|
||||||
|
@ -1114,7 +1114,7 @@ fn write_columns(
|
||||||
for (i, cell) in row.iter().enumerate() {
|
for (i, cell) in row.iter().enumerate() {
|
||||||
if cell.is_none() && options.merge_files_print.is_some() {
|
if cell.is_none() && options.merge_files_print.is_some() {
|
||||||
out.write_all(
|
out.write_all(
|
||||||
get_line_for_printing(&options, &blank_line, columns, i, &line_width, indexes)
|
get_line_for_printing(options, &blank_line, columns, i, &line_width, indexes)
|
||||||
.as_bytes(),
|
.as_bytes(),
|
||||||
)?;
|
)?;
|
||||||
} else if cell.is_none() {
|
} else if cell.is_none() {
|
||||||
|
@ -1124,7 +1124,7 @@ fn write_columns(
|
||||||
let file_line = cell.unwrap();
|
let file_line = cell.unwrap();
|
||||||
|
|
||||||
out.write_all(
|
out.write_all(
|
||||||
get_line_for_printing(&options, file_line, columns, i, &line_width, indexes)
|
get_line_for_printing(options, file_line, columns, i, &line_width, indexes)
|
||||||
.as_bytes(),
|
.as_bytes(),
|
||||||
)?;
|
)?;
|
||||||
lines_printed += 1;
|
lines_printed += 1;
|
||||||
|
@ -1149,7 +1149,7 @@ fn get_line_for_printing(
|
||||||
indexes: usize,
|
indexes: usize,
|
||||||
) -> String {
|
) -> String {
|
||||||
let blank_line = String::new();
|
let blank_line = String::new();
|
||||||
let formatted_line_number = get_formatted_line_number(&options, file_line.line_number, index);
|
let formatted_line_number = get_formatted_line_number(options, file_line.line_number, index);
|
||||||
|
|
||||||
let mut complete_line = format!(
|
let mut complete_line = format!(
|
||||||
"{}{}",
|
"{}{}",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue