Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An error occurred deserializing u64 #438

Closed
LULU233333 opened this issue Jan 15, 2023 · 1 comment
Closed

An error occurred deserializing u64 #438

LULU233333 opened this issue Jan 15, 2023 · 1 comment

Comments

@LULU233333
Copy link

use serde::{Deserialize, Serialize};

#[derive(Debug, Deserialize, Serialize)]
struct U64Test {
    value: u64,
}

fn main() {
    let text = toml::to_string(&U64Test { value: u64::MAX }).unwrap();
    println!("{text}");
    let _: U64Test = toml::from_str(&text).unwrap();
}

cargo run:
value = 18446744073709551615

thread 'main' panicked at 'called Result::unwrap() on an Err value: Error { inner: ErrorInner { kind: NumberInvalid, line: Some(0), col: 8, at: Some(8), message: "", key: [] } }', src\main.rs:11:44

epage added a commit to epage/toml_edit that referenced this issue Jan 16, 2023
This is to ensure toml-rs#438 doesn't apply to `toml_edit`s parser and
generator.

The parser already had unit tests for this but not the generator.
epage added a commit to epage/toml_edit that referenced this issue Jan 16, 2023
This is to ensure toml-rs#438 doesn't apply to `toml_edit`s parser and
generator.

The parser already had unit tests for this but not the generator.
@epage
Copy link
Member

epage commented Jan 18, 2023

#442 verified that toml_edit does not have this problem and #457 moved toml to use toml_edit. I'm going to close this as fixed.

@epage epage closed this as completed Jan 18, 2023
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

No branches or pull requests

2 participants