Skip to content

fix: support u64 for parse json file#758

Merged
epage merged 1 commit into
rust-cli:mainfrom
deftsp:try_u64_to_value
Jun 16, 2026
Merged

fix: support u64 for parse json file#758
epage merged 1 commit into
rust-cli:mainfrom
deftsp:try_u64_to_value

Conversation

@deftsp

@deftsp deftsp commented May 29, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@epage

epage commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Thanks!

@epage epage merged commit 13c188b into rust-cli:main Jun 16, 2026
14 of 15 checks passed
epage pushed a commit that referenced this pull request Jun 26, 2026
`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).
epage added a commit that referenced this pull request Jun 26, 2026
…761)

## Problem

`ron::Number::U64` is currently handled as:

```rust
ron::Number::U64(value) => ValueKind::I64(value.try_into()?),
```

Any `u64` value exceeding `i64::MAX` (~9.2e18) causes a `try_into()`
error, silently breaking RON configs that use large unsigned integers.

## Fix

Mirror the pattern applied to the JSON handler in #758:

```rust
ron::Number::U64(value) => ValueKind::U64(value),
```

Also removes the now-unused `use std::convert::TryInto as _;` import —
`TryInto` is in the Rust 2021+ prelude, and keeping the import after
removing the only `try_into()` call would produce an unused-import
warning (CI runs with warnings-as-errors).

## Verification

- `cargo build` — clean, no warnings
- `cargo test` — 166 tests pass (13 unit + 146 integration + 7 doc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants