Review: a whole number past i64::MAX is past any maximum; ROADMAP (#1091)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bflatastic 2026-10-11 11:49:36 +07:00
parent aecf88c1c1
commit 5e9b7d09a2
2 changed files with 4 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@ -206,8 +206,9 @@ impl Manifest {
// Keep JSON integers exact: f64 cannot represent every i64 or its bounds.
let value = if let Some(i) = v.as_i64() {
i.clamp(*min, *max)
} else if let Some(i) = v.as_u64() {
i128::from(i).clamp(i128::from(*min), i128::from(*max)) as i64
} else if v.is_u64() {
// Past i64::MAX, so past any maximum.
*max
} else {
let f = v.as_f64().filter(|f| f.is_finite()).ok_or_else(|| wrong("a number"))?;
(f.round() as i64).clamp(*min, *max)