mirror of
https://github.com/uutils/coreutils
synced 2024-12-14 23:32:39 +00:00
Fix typo and code formatting
This commit is contained in:
parent
16b569ee18
commit
5986b77e1c
1 changed files with 13 additions and 5 deletions
|
@ -180,17 +180,25 @@ fn hashsum(algoname: &str, mut digest: Box<Digest>, files: Vec<String>, binary:
|
|||
);
|
||||
if check {
|
||||
|
||||
// Set up Regexs for line validation and parsing
|
||||
// Set up Regexes for line validation and parsing
|
||||
let bytes = digest.output_bits() / 4;
|
||||
let gnu_re = safe_unwrap!(Regex::new(format!(
|
||||
let gnu_re = safe_unwrap!(
|
||||
Regex::new(
|
||||
format!(
|
||||
r"^(?P<digest>[a-fA-F0-9]{{{}}}) (?P<binary>[ \*])(?P<fileName>.*)",
|
||||
bytes
|
||||
).as_slice()));
|
||||
let bsd_re = safe_unwrap!(Regex::new(format!(
|
||||
).as_slice()
|
||||
)
|
||||
);
|
||||
let bsd_re = safe_unwrap!(
|
||||
Regex::new(
|
||||
format!(
|
||||
r"^{algorithm} \((?P<fileName>.*)\) = (?P<digest>[a-fA-F0-9]{{{digest_size}}})",
|
||||
algorithm = algoname,
|
||||
digest_size = bytes
|
||||
).as_slice()));
|
||||
).as_slice()
|
||||
)
|
||||
);
|
||||
|
||||
let mut buffer = file;
|
||||
for (i, line) in buffer.lines().enumerate() {
|
||||
|
|
Loading…
Reference in a new issue