utils/flexver: handle i64 overflow gracefully
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I66386d97f92744a5c07c04b072bc1a626a6a6964
This commit is contained in:
parent
530ba8b581
commit
a8bf8f9f3f
1 changed files with 6 additions and 4 deletions
|
|
@ -79,10 +79,12 @@ fn decompose(str_in: &str) -> VecDeque<SortingType> {
|
|||
if numeric {
|
||||
return None;
|
||||
} else {
|
||||
return Some(Numerical(
|
||||
current.parse::<i64>().unwrap(),
|
||||
current.to_owned(),
|
||||
));
|
||||
return Some(
|
||||
current
|
||||
.parse::<i64>()
|
||||
.map(|n| Numerical(n, current.to_owned()))
|
||||
.unwrap_or_else(|_| Lexical(current.to_owned())),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue