style: fix deprecations

Use `dyn` for trait objects and use `..=` for inclusive ranges.
This commit is contained in:
Andrew Gallant
2019-06-16 18:37:51 -04:00
parent 9f000c2910
commit 7b9972c308
6 changed files with 16 additions and 14 deletions

View File

@@ -1,3 +1,4 @@
use std::error;
use std::fmt;
use std::io;
@@ -49,9 +50,9 @@ impl SinkError for io::Error {
/// A `Box<std::error::Error>` can be used as an error for `Sink`
/// implementations out of the box.
impl SinkError for Box<::std::error::Error> {
fn error_message<T: fmt::Display>(message: T) -> Box<::std::error::Error> {
Box::<::std::error::Error>::from(message.to_string())
impl SinkError for Box<dyn error::Error> {
fn error_message<T: fmt::Display>(message: T) -> Box<dyn error::Error> {
Box::<dyn error::Error>::from(message.to_string())
}
}