mirror of
https://github.com/uutils/coreutils
synced 2024-12-15 07:42:48 +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 {
|
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 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>.*)",
|
r"^(?P<digest>[a-fA-F0-9]{{{}}}) (?P<binary>[ \*])(?P<fileName>.*)",
|
||||||
bytes
|
bytes
|
||||||
).as_slice()));
|
).as_slice()
|
||||||
let bsd_re = safe_unwrap!(Regex::new(format!(
|
)
|
||||||
|
);
|
||||||
|
let bsd_re = safe_unwrap!(
|
||||||
|
Regex::new(
|
||||||
|
format!(
|
||||||
r"^{algorithm} \((?P<fileName>.*)\) = (?P<digest>[a-fA-F0-9]{{{digest_size}}})",
|
r"^{algorithm} \((?P<fileName>.*)\) = (?P<digest>[a-fA-F0-9]{{{digest_size}}})",
|
||||||
algorithm = algoname,
|
algorithm = algoname,
|
||||||
digest_size = bytes
|
digest_size = bytes
|
||||||
).as_slice()));
|
).as_slice()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
let mut buffer = file;
|
let mut buffer = file;
|
||||||
for (i, line) in buffer.lines().enumerate() {
|
for (i, line) in buffer.lines().enumerate() {
|
||||||
|
|
Loading…
Reference in a new issue