16 Commits

Author SHA1 Message Date
David Tolnay
e757a3d881
Switch from ryu -> zmij for float formatting 2025-12-23 14:02:16 -08:00
David Tolnay
caef3c6ea6
Ignore uninlined_format_args pedantic clippy lint
warning: variables can be used directly in the `format!` string
       --> src/ser.rs:448:15
        |
    448 |         match write!(adapter, "{}", value) {
        |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
        = note: `-W clippy::uninlined-format-args` implied by `-W clippy::pedantic`
        = help: to override `-W clippy::pedantic` add `#[allow(clippy::uninlined_format_args)]`
    help: change this to
        |
    448 -         match write!(adapter, "{}", value) {
    448 +         match write!(adapter, "{value}") {
        |

    warning: variables can be used directly in the `format!` string
       --> src/value/mod.rs:182:37
        |
    182 |             Value::Bool(boolean) => write!(formatter, "Bool({})", boolean),
        |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
        |
    182 -             Value::Bool(boolean) => write!(formatter, "Bool({})", boolean),
    182 +             Value::Bool(boolean) => write!(formatter, "Bool({boolean})"),
        |

    warning: variables can be used directly in the `format!` string
       --> src/value/mod.rs:184:38
        |
    184 |             Value::String(string) => write!(formatter, "String({:?})", string),
        |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
        |
    184 -             Value::String(string) => write!(formatter, "String({:?})", string),
    184 +             Value::String(string) => write!(formatter, "String({string:?})"),
        |

    warning: variables can be used directly in the `format!` string
       --> src/number.rs:365:9
        |
    365 |         write!(formatter, "Number({})", self)
        |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
        |
    365 -         write!(formatter, "Number({})", self)
    365 +         write!(formatter, "Number({self})")
        |
2025-09-13 16:34:07 -07:00
David Tolnay
cb2515ba44
Make Display for Number produce the same representation as serializing 2022-08-21 13:56:31 -07:00
David Tolnay
8ba854166d
Preserve '.0' when Displaying Number 2022-08-21 13:39:11 -07:00
David Tolnay
de251c8198
Add test of Display for Number containing float 2022-08-21 13:37:56 -07:00
David Tolnay
dd6a86db07
Reduce unneeded parens and newlines in Debug for Value 2022-08-21 13:11:47 -07:00
David Tolnay
de62e3e406
Make Debug test compatible with preserve_order 2022-08-21 13:00:58 -07:00
David Tolnay
0671603282
Cover all the Value variants in indented Debug test 2022-08-21 12:59:04 -07:00
David Tolnay
a047355bcd
Move expected value for indented debug test into test 2022-08-21 12:57:19 -07:00
David Tolnay
351d847e17
Omit a layer of unnecessary nesting from Debug impl 2020-05-09 16:30:09 -07:00
David Tolnay
baae6d9306
Add test for {:#?} format of Value 2020-05-09 16:27:55 -07:00
David Tolnay
3040daa1c6
Update tests to 2018 edition 2020-01-22 13:45:47 -08:00
David Tolnay
28ea01fbb9
Cleaner Debug representation of Error 2018-03-28 15:08:47 +02:00
David Tolnay
654e6e8349
Format with rustfmt 0.4.1 2018-03-27 10:24:10 +02:00
David Tolnay
bfd4562d74
Hide Number implementation details from Debug representation 2017-12-30 13:28:30 -05:00
David Tolnay
81c7298c86
Test the debug representations of Number and Value 2017-12-30 13:21:00 -05:00