From 1814545bc6aa86498b3cf107142aed1c66567e66 Mon Sep 17 00:00:00 2001 From: Doehyun Baek Date: Mon, 26 Aug 2024 17:17:27 +0900 Subject: [PATCH] print out warning when parsing potential problems --- crates/replay_gen/src/trace.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/replay_gen/src/trace.rs b/crates/replay_gen/src/trace.rs index d56881e..ea523e5 100644 --- a/crates/replay_gen/src/trace.rs +++ b/crates/replay_gen/src/trace.rs @@ -192,6 +192,10 @@ fn parse_number(s: &str) -> Option { "-Infinity" => Some(F64(std::f64::NEG_INFINITY)), _ => { if let Ok(num) = s.parse::() { + let round_trip = num.to_string(); + if round_trip != s { + eprintln!("WARNING: roundtrip of {s}: {round_trip}"); + } Some(F64(num)) // Handle floats and scientific notation } else { None // Not a number