summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2019-06-16 18:37:51 -0400
committerAndrew Gallant <jamslam@gmail.com>2019-06-16 18:37:51 -0400
commit7b9972c30876797103d6b51c14dd8f9bf1001c92 (patch)
treefa4e1c6c75c23de5a5552470d173e02d78bd5575 /src
parent9f000c29109cf369c4c28254f0cf9b9216a1950d (diff)
style: fix deprecations
Use `dyn` for trait objects and use `..=` for inclusive ranges.
Diffstat (limited to 'src')
-rw-r--r--src/config.rs4
-rw-r--r--src/main.rs3
2 files changed, 4 insertions, 3 deletions
diff --git a/src/config.rs b/src/config.rs
index a5e492ec..f0f7929c 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -55,7 +55,7 @@ pub fn args() -> Vec<OsString> {
/// for each line in addition to successfully parsed arguments.
fn parse<P: AsRef<Path>>(
path: P,
-) -> Result<(Vec<OsString>, Vec<Box<Error>>)> {
+) -> Result<(Vec<OsString>, Vec<Box<dyn Error>>)> {
let path = path.as_ref();
match File::open(&path) {
Ok(file) => parse_reader(file),
@@ -76,7 +76,7 @@ fn parse<P: AsRef<Path>>(
/// in addition to successfully parsed arguments.
fn parse_reader<R: io::Read>(
rdr: R,
-) -> Result<(Vec<OsString>, Vec<Box<Error>>)> {
+) -> Result<(Vec<OsString>, Vec<Box<dyn Error>>)> {
let bufrdr = io::BufReader::new(rdr);
let (mut args, mut errs) = (vec![], vec![]);
let mut line_number = 0;
diff --git a/src/main.rs b/src/main.rs
index bed33296..6c8826b4 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,3 +1,4 @@
+use std::error;
use std::io::{self, Write};
use std::process;
use std::sync::{Arc, Mutex};
@@ -42,7 +43,7 @@ mod subject;
#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
-type Result<T> = ::std::result::Result<T, Box<::std::error::Error>>;
+type Result<T> = ::std::result::Result<T, Box<dyn error::Error>>;
fn main() {
if let Err(err) = Args::parse().and_then(try_main) {