Highlight numbers (int) as string in formatted JSON

This commit is contained in:
John Braun 2021-10-08 15:07:15 +02:00
parent 602a327aa8
commit 5b4e4bb858
1 changed files with 4 additions and 0 deletions

View File

@ -555,6 +555,10 @@ impl<'a, A: AsRef<[u8]>> Formatter<'a, A> {
})
.collect(),
),
Value::Number(number) => {
let number_string_value = self.format_string(number.to_string(), matcher, format_options);
Value::String(number_string_value)
}
value => value,
}
}