Commit graph

6 commits

Author SHA1 Message Date
David Tolnay
080cac54d4
Ignore uninlined_format_args pedantic clippy lint
warning: variables can be used directly in the `format!` string
      --> tests/test_generics.rs:93:5
       |
    93 |     assert_eq!(format!("{}", instance), "display only DebugOnly");
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
       |
    93 -     assert_eq!(format!("{}", instance), "display only DebugOnly");
    93 +     assert_eq!(format!("{instance}"), "display only DebugOnly");
       |

    warning: variables can be used directly in the `format!` string
      --> tests/test_generics.rs:96:5
       |
    96 |     assert_eq!(format!("{}", instance), "display only");
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
       |
    96 -     assert_eq!(format!("{}", instance), "display only");
    96 +     assert_eq!(format!("{instance}"), "display only");
       |

    warning: variables can be used directly in the `format!` string
      --> tests/test_generics.rs:99:5
       |
    99 |     assert_eq!(format!("{}", instance), "DebugOnly");
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
       |
    99 -     assert_eq!(format!("{}", instance), "DebugOnly");
    99 +     assert_eq!(format!("{instance}"), "DebugOnly");
       |

    warning: `thiserror` (test "test_generics") generated 3 warnings (run `cargo clippy --fix --test "test_generics"` to apply 3 suggestions)
    warning: variables can be used directly in the `format!` string
       --> tests/test_display.rs:129:20
        |
    129 |         Some(n) => format!("error occurred with {}", n),
        |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
        |
    129 -         Some(n) => format!("error occurred with {}", n),
    129 +         Some(n) => format!("error occurred with {n}"),
        |

    warning: variables can be used directly in the `format!` string
       --> tests/test_display.rs:153:32
        |
    153 |                     Some(n) => write!(formatter, "error occurred with {}", n),
        |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
        |
    153 -                     Some(n) => write!(formatter, "error occurred with {}", n),
    153 +                     Some(n) => write!(formatter, "error occurred with {n}"),
        |
2023-09-02 13:14:40 -07:00
David Tolnay
dd9206cfd0
Remove clippy deny attributes from test suite
These were superseded by the clippy invocation made in our CI workflow:

    run: cargo clippy --tests -- -Dclippy::all -Dclippy::pedantic
2022-04-24 15:22:58 -07:00
David Tolnay
604e47ccbd
Ignore needless_late_init Clippy lint in test
error: unneeded late initalization
      --> tests/test_generics.rs:90:5
       |
    90 |     let mut instance: EnumCompound<DisplayOnly, DebugOnly, NoFormat>;
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
    help: declare `instance` here
       |
    92 |     let mut instance: EnumCompound<DisplayOnly, DebugOnly, NoFormat> = EnumCompound::DisplayDebug(DisplayOnly, DebugOnly);
       |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-12-07 18:36:06 -08:00
David Tolnay
42d36e5806
Add test with generic transparent field 2021-09-04 19:38:00 -07:00
David Tolnay
1e6e267914
Implied bounds for Display and Error impl 2021-09-04 18:21:37 -07:00
David Tolnay
81b881063f
Add test of generic error types 2021-09-04 18:21:36 -07:00