mirror of
https://github.com/sharkdp/fd
synced 2024-11-02 15:11:27 +00:00
Make compatible with min rust version
This commit is contained in:
parent
2f3b472dfd
commit
ace3f512d3
1 changed files with 10 additions and 4 deletions
|
@ -70,16 +70,22 @@ impl SizeFilter {
|
|||
return None;
|
||||
}
|
||||
|
||||
let captures = SIZE_CAPTURES.captures(s)?;
|
||||
let captures = match SIZE_CAPTURES.captures(s) {
|
||||
Some(cap) => cap,
|
||||
None => return None,
|
||||
};
|
||||
|
||||
let limit = match captures.get(1).map_or("+", |m| m.as_str()) {
|
||||
"+" => SizeLimitType::Min,
|
||||
_ => SizeLimitType::Max,
|
||||
};
|
||||
|
||||
let quantity = match captures.get(2)?.as_str().parse::<u64>() {
|
||||
let quantity = match captures.get(2) {
|
||||
None => return None,
|
||||
Some(v) => match v.as_str().parse::<u64>() {
|
||||
Ok(val) => val,
|
||||
_ => return None,
|
||||
},
|
||||
};
|
||||
|
||||
let multiplier = match &captures.get(3).map_or("k", |m| m.as_str()).to_lowercase()[..] {
|
||||
|
|
Loading…
Reference in a new issue