uutils / coreutils

Cross-platform Rust rewrite of the GNU coreutils
https://uutils.github.io/
MIT License
17.23k stars 1.24k forks source link

uucore/checksum: simplify `determine_regex()` #6500

Closed cakebaker closed 6 days ago

cakebaker commented 6 days ago

This PR simplifies the signature of the determine_regex function from:

fn determine_regex(filename: &OsStr, input_is_stdin: bool, lines: &[String]) -> UResult<(Regex, bool)>

to

fn determine_regex(lines: &[String]) -> Option<(Regex, bool)>
sylvestre commented 6 days ago

nice, thanks