From 55d441875b3a06cbef4a445322317da38b625974 Mon Sep 17 00:00:00 2001 From: greymoth Date: Sat, 27 Jun 2026 01:30:10 +0900 Subject: [PATCH] fix(ron): map u64 values to ValueKind::U64 instead of lossy I64 cast `ron::Number::U64` was cast via `try_into()?` to `ValueKind::I64`, which silently errors for any value exceeding `i64::MAX` (~9.2e18). Mirror the fix applied to the JSON handler in PR #758: map U64 directly to `ValueKind::U64(value)`. Also removes the now-unused `use std::convert::TryInto as _;` import (TryInto is in the Rust 2021+ prelude; keeping it would trigger an unused-import warning). --- src/file/format/ron.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/file/format/ron.rs b/src/file/format/ron.rs index 7b4aeb6c..f74db8fe 100644 --- a/src/file/format/ron.rs +++ b/src/file/format/ron.rs @@ -1,4 +1,3 @@ -use std::convert::TryInto as _; use std::error::Error; use crate::format; @@ -37,7 +36,7 @@ fn from_ron_value( ron::Number::U8(value) => ValueKind::I64(value.into()), ron::Number::U16(value) => ValueKind::I64(value.into()), ron::Number::U32(value) => ValueKind::I64(value.into()), - ron::Number::U64(value) => ValueKind::I64(value.try_into()?), + ron::Number::U64(value) => ValueKind::U64(value), _ => Err(crate::ConfigError::Message( "unsupported numeric type".to_owned(), ))?,