From 80e3d02cb4315bf99baf2ec2c2984a1bf7e37ea0 Mon Sep 17 00:00:00 2001 From: Thomas Heck Date: Thu, 7 Apr 2022 20:47:47 +0200 Subject: [PATCH] refactor: simplify config processing --- src/config.rs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/config.rs b/src/config.rs index 0821f49..ba57269 100644 --- a/src/config.rs +++ b/src/config.rs @@ -288,15 +288,8 @@ pub fn config() -> Result { .context("Could not canonicalize \"to\" path")?, matches: transcode_matches, jobs: arg_matches - .value_of_os("jobs") - .map(|jobs_os_str| { - let jobs_str = jobs_os_str.to_str().with_context(|| { - // TODO: use `OsStr.display` when it lands - // https://github.com/rust-lang/rust/pull/80841 - format!( - "Could not convert \"jobs\" argument to string due to invalid characters", - ) - })?; + .value_of("jobs") + .map(|jobs_str| { jobs_str.parse().with_context(|| { format!( "Could not parse \"jobs\" argument \"{}\" to a number",