hjson / hjson-rust

Hjson for Rust
https://hjson.github.io/
MIT License
97 stars 31 forks source link

Numbers are always be parsed to Value::F64 #8

Closed zonyitoo closed 5 years ago

zonyitoo commented 5 years ago
{
  # specify rate in requests/second (because comments are helpful!)
  rate: 1000
}

This is the example taken from README. And we have to use the value of rate by as_f64 like this:

let rate = sample.get("rate").unwrap().as_f64().unwrap();

1000 should be Value::U64 or at least Value::I64.

Maybe we can represent number values as Value::Number like serde-json does?