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

Fix clippy::format_collect.

This commit is contained in:
David Campbell 2024-09-25 12:48:48 -04:00
parent 3c26dd869e
commit ae01996066
No known key found for this signature in database
GPG key ID: C2E99A0CF863A603

View file

@ -23,6 +23,7 @@ use crate::{
}, },
util_name, util_name,
}; };
use std::fmt::Write;
use std::io::stdin; use std::io::stdin;
use std::io::BufRead; use std::io::BufRead;
use thiserror::Error; use thiserror::Error;
@ -321,10 +322,10 @@ fn determine_regex(lines: &[String]) -> Option<(Regex, bool)> {
// Converts bytes to a hexadecimal string // Converts bytes to a hexadecimal string
fn bytes_to_hex(bytes: &[u8]) -> String { fn bytes_to_hex(bytes: &[u8]) -> String {
bytes bytes.iter().fold(String::new(), |mut bytes, byte| {
.iter() write!(bytes, "{byte:02x}").unwrap();
.map(|byte| format!("{byte:02x}")) bytes
.collect::<String>() })
} }
fn get_expected_checksum( fn get_expected_checksum(