From 5730c8693f2bb01289adc8a1deaae49902df353e Mon Sep 17 00:00:00 2001 From: 353fc443 <353fc443@pm.me> Date: Tue, 13 Jul 2021 07:25:18 +0000 Subject: [PATCH] sleep: fixing clippy warnings --- src/uu/sleep/src/sleep.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/uu/sleep/src/sleep.rs b/src/uu/sleep/src/sleep.rs index 684f98c95..1cb858a34 100644 --- a/src/uu/sleep/src/sleep.rs +++ b/src/uu/sleep/src/sleep.rs @@ -5,6 +5,9 @@ // * For the full copyright and license information, please view the LICENSE // * file that was distributed with this source code. +// clippy bug https://github.com/rust-lang/rust-clippy/issues/7422 +#![allow(clippy::nonstandard_macro_braces)] + #[macro_use] extern crate uucore; @@ -70,9 +73,9 @@ fn sleep(args: Vec<&str>) -> UResult<()> { Duration::new(0, 0), |result, arg| match uucore::parse_time::from_str(&arg[..]) { Ok(m) => Ok(m + result), - Err(f) => Err(USimpleError::new(1, format!("{}", f))), + Err(f) => Err(USimpleError::new(1, f)), }, )?; - - Ok(thread::sleep(sleep_dur)) + thread::sleep(sleep_dur); + Ok(()) }