Skip to content
This repository has been archived by the owner on Nov 23, 2024. It is now read-only.

Commit

Permalink
Add #[allow(dead_code)] to stop warning
Browse files Browse the repository at this point in the history
  • Loading branch information
upsuper committed Jul 13, 2024
1 parent adc23d3 commit 929cf0b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/bot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,13 @@ where
}
}

// All the inner fields are used as part of `Debug` output, so they are not dead code.
// But rustc explicitly excludes derive from dead code analysis, thus we need to allow dead code
// below to avoid triggering the warning.
#[derive(Debug, From)]
pub enum Error {
Request(reqwest::Error),
Api(ApiError),
Request(#[allow(dead_code)] reqwest::Error),
Api(#[allow(dead_code)] ApiError),
Parse(ParseError),
}

Expand Down

0 comments on commit 929cf0b

Please sign in to comment.