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 (unneeded mut)

This commit is contained in:
Roy Ivy III 2019-12-26 15:40:58 -06:00
parent 25b1f98cf8
commit bc558f301a
3 changed files with 5 additions and 5 deletions

View file

@ -104,7 +104,7 @@ pub fn parse_format_flags(args: &Vec<String>) -> Result<Vec<ParsedFormatterItemI
let mut formats = Vec::new(); let mut formats = Vec::new();
// args[0] is the name of the binary // args[0] is the name of the binary
let mut arg_iter = args.iter().skip(1); let arg_iter = args.iter().skip(1);
let mut expect_type_string = false; let mut expect_type_string = false;
for arg in arg_iter { for arg in arg_iter {
@ -129,7 +129,7 @@ pub fn parse_format_flags(args: &Vec<String>) -> Result<Vec<ParsedFormatterItemI
expect_type_string = true; expect_type_string = true;
} }
} else if arg.starts_with("-") { } else if arg.starts_with("-") {
let mut flags = arg.chars().skip(1); let flags = arg.chars().skip(1);
let mut format_spec = String::new(); let mut format_spec = String::new();
for c in flags { for c in flags {
if expect_type_string { if expect_type_string {

View file

@ -47,7 +47,7 @@ impl FloatAnalysis {
// this fn assumes // this fn assumes
// the input string // the input string
// has no leading spaces or 0s // has no leading spaces or 0s
let mut str_it = get_it_at(inprefix.offset, str_in); let str_it = get_it_at(inprefix.offset, str_in);
let mut ret = FloatAnalysis { let mut ret = FloatAnalysis {
len_important: 0, len_important: 0,
decimal_pos: None, decimal_pos: None,
@ -251,7 +251,7 @@ pub fn get_primitive_dec(
} else { } else {
match first_segment.chars().next() { match first_segment.chars().next() {
Some('0') => { Some('0') => {
let mut it = second_segment.chars().enumerate(); let it = second_segment.chars().enumerate();
let mut m: isize = 0; let mut m: isize = 0;
let mut pre = String::from("0"); let mut pre = String::from("0");
let mut post = String::from("0"); let mut post = String::from("0");

View file

@ -456,7 +456,7 @@ fn bounded_tail(mut file: &File, settings: &Settings) {
// Find the position in the file to start printing from. // Find the position in the file to start printing from.
match settings.mode { match settings.mode {
FilterMode::Lines(mut count, delimiter) => { FilterMode::Lines(mut count, delimiter) => {
backwards_thru_file(&mut file, size, &mut buf, delimiter, &mut |byte| { backwards_thru_file(&file, size, &mut buf, delimiter, &mut |byte| {
if byte == delimiter { if byte == delimiter {
count -= 1; count -= 1;
count == 0 count == 0