mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 23:02:31 +00:00
Use map_or instead of match
This commit is contained in:
parent
5ff2bb4dcf
commit
c5c64d48b7
1 changed files with 4 additions and 4 deletions
|
@ -8,9 +8,9 @@ impl _StrExt for str {
|
|||
if index == self.len() {
|
||||
return true;
|
||||
}
|
||||
match self.as_bytes().get(index) {
|
||||
None => false,
|
||||
Some(&b) => b < 128 || b >= 192,
|
||||
}
|
||||
|
||||
self.as_bytes()
|
||||
.get(index)
|
||||
.map_or(false, |&b| b < 128 || b >= 192)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue