eyre-rs / eyre

A trait object based error handling type for easy idiomatic error handling and reporting in Rust applications
Apache License 2.0
1.39k stars 66 forks source link

fix(color_eyre): build warnings #182

Closed joshka closed 3 months ago

joshka commented 3 months ago

Remove structs that are unused and have been migrated to use the eyre versions of the same:

Add cfg guards to the DisplayExt, FooterWriter, Footer, and Header to prevent unused warnings when the issue-url feature is not enabled.


Warnings:

   Compiling color-eyre v0.6.2 (/Users/joshka/local/eyre/color-eyre)
warning: struct `InstallError` is never constructed
   --> color-eyre/src/config.rs:15:8
    |
15  | struct InstallError;
    |        ^^^^^^^^^^^^
    |
note: the lint level is defined here
   --> color-eyre/src/lib.rs:352:5
    |
352 |     unused,
    |     ^^^^^^
    = note: `#[warn(dead_code)]` implied by `#[warn(unused)]`

warning: struct `InstallThemeError` is never constructed
  --> color-eyre/src/config.rs:26:8
   |
26 | struct InstallThemeError;
   |        ^^^^^^^^^^^^^^^^^

warning: struct `InstallColorSpantraceThemeError` is never constructed
  --> color-eyre/src/config.rs:37:8
   |
37 | struct InstallColorSpantraceThemeError;
   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: trait `DisplayExt` is never used
  --> color-eyre/src/writers.rs:31:18
   |
31 | pub(crate) trait DisplayExt: Sized + Display {
   |                  ^^^^^^^^^^

warning: struct `FooterWriter` is never constructed
  --> color-eyre/src/writers.rs:83:19
   |
83 | pub(crate) struct FooterWriter<W> {
   |                   ^^^^^^^^^^^^

warning: struct `Footer` is never constructed
   --> color-eyre/src/writers.rs:102:19
    |
102 | pub(crate) struct Footer<B, H>
    |                   ^^^^^^

warning: struct `Header` is never constructed
   --> color-eyre/src/writers.rs:133:19
    |
133 | pub(crate) struct Header<B, H>
    |                   ^^^^^^

warning: `color-eyre` (lib) generated 7 warnings