Skip to main content

number_tokens

Function number_tokens 

Source
fn number_tokens(line: &str) -> Vec<f64>
Expand description

Number literals appearing outside string literals, in order. With serde_json’s preserve_order, two serialisations of the same Value can only differ in these, so the number of these tokens is what decides whether a re-encode lost structure. Values are parsed to f64 only to keep the sequence numbers, not compared: a 17-digit float’s parse drifts by one ulp, so equality would reject the very re-spelling this gate exists to allow.