From a8bf8f9f3fa8c4eb08242e6a66f50c4769a5643a Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sat, 18 Apr 2026 21:52:57 +0300 Subject: [PATCH] utils/flexver: handle i64 overflow gracefully Signed-off-by: NotAShelf Change-Id: I66386d97f92744a5c07c04b072bc1a626a6a6964 --- src/utils/flexver.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/utils/flexver.rs b/src/utils/flexver.rs index 7290776..ffd77bb 100644 --- a/src/utils/flexver.rs +++ b/src/utils/flexver.rs @@ -79,10 +79,12 @@ fn decompose(str_in: &str) -> VecDeque { if numeric { return None; } else { - return Some(Numerical( - current.parse::().unwrap(), - current.to_owned(), - )); + return Some( + current + .parse::() + .map(|n| Numerical(n, current.to_owned())) + .unwrap_or_else(|_| Lexical(current.to_owned())), + ); } }