ResponseError requires Debug + Display, but it seems unnecessary
- Langage dominant
- Rust
- Étoiles
- 24.8k
- Forks
- 1.9k
- Merge moyen
- 23 h 10 min
- PR mergées (30 j)
- 26
Description
Currently ResponseError is defined as:
```
// TODO: flesh out documentation
pub trait ResponseError: fmt::Debug + fmt::Display {
```
However I see no real reason why it requires Display, or even Debug.
The default implementation indeed requires Display:
```
let _ = write!(helpers::MutWriter(&mut buf), "{}", self);
```
However this means that we cannot implement ResponseError for any types that don't implement Display and Debug, which is cumbersome, because sometimes I just want to return a static string without relying on whether the type implements Debug or Display, and even if it does, I don't really intend to use it.
Not sure what the correct way would be to leave the default implementation as is, but also allow non-display, non-debug types to implement it.
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.