tomaka / rouille

Web framework in Rust
Apache License 2.0
1.09k stars 105 forks source link

Error::Description is deprecated #206

Closed rushsteve1 closed 4 years ago

rushsteve1 commented 5 years ago

The function Error::description() is soft-deprecated: https://doc.rust-lang.org/std/error/trait.Error.html

It is only used in one place in try_or_400! https://github.com/tomaka/rouille/blob/421f45dc38e755f80076f9b63afdff9580e0de16/src/try_or_400.rs#L59

But will cause a separate and unhelpful error if called on an Error that does not manually implement description(). The alternative is using to_string().

Edit: Additionally Error::cause() has been deprecated in favor of Error::source(). I just noticed.