Closed
Description
What it does
Warns on types which implement std::error::Error
being named Error
.
Advantage
Removes needing to document against using this common pattern.
The reasons against this pattern is that it can reduce readability and requires error types be renamed when imported (which can further reduce readability).
When you have 20 types named Error
in your project it can become annoying.
Drawbacks
Adds an additional lint to clippy.
Example
#[derive(Debug, thiserror::Error)]
pub enum Error { /* ... */ }
Could be written as:
#[derive(Debug, thiserror::Error)]
pub enum MySpecificError { /* ... */ }
#[derive(Debug)]
pub enum Error { /* ... */}
impl std::error::Error for Error { /* ... */ }
Could be written as:
#[derive(Debug)]
pub enum MySpecificError { /* ... */}
impl std::error::Error for Error { /* ... */ }