diff --git a/src/cp/cp.rs b/src/cp/cp.rs index ce3aa1b06..454ce6869 100644 --- a/src/cp/cp.rs +++ b/src/cp/cp.rs @@ -946,7 +946,7 @@ impl OverwriteMode { fn copy_attribute(source: &Path, dest: &Path, attribute: &Attribute) -> CopyResult<()> { let context = &*format!("'{}' -> '{}'", source.display().to_string(), dest.display()); - Ok(match *attribute { + match *attribute { #[cfg(unix)] Attribute::Mode => { let mode = fs::metadata(source).context(context)?.permissions().mode(); @@ -982,7 +982,8 @@ fn copy_attribute(source: &Path, dest: &Path, attribute: &Attribute) -> CopyResu return Err("XAttrs are only supported on unix.".to_string().into()); } } - }) + }; + Ok(()) } #[cfg(not(windows))] diff --git a/src/expr/syntax_tree.rs b/src/expr/syntax_tree.rs index be668baec..539493737 100644 --- a/src/expr/syntax_tree.rs +++ b/src/expr/syntax_tree.rs @@ -298,17 +298,18 @@ fn push_token_to_either_stack( op_stack: &mut TokenStack, ) -> Result<(), String> { let result = match *token { - Token::Value { .. } => Ok(out_stack.push((token_idx, token.clone()))), + Token::Value { .. } => { out_stack.push((token_idx, token.clone())); Ok(()) }, Token::InfixOp { .. } => if op_stack.is_empty() { - Ok(op_stack.push((token_idx, token.clone()))) + op_stack.push((token_idx, token.clone())); + Ok(()) } else { push_op_to_stack(token_idx, token, out_stack, op_stack) }, - Token::PrefixOp { .. } => Ok(op_stack.push((token_idx, token.clone()))), + Token::PrefixOp { .. } => { op_stack.push((token_idx, token.clone())); Ok(()) }, - Token::ParOpen => Ok(op_stack.push((token_idx, token.clone()))), + Token::ParOpen => { op_stack.push((token_idx, token.clone())); Ok(()) }, Token::ParClose => move_till_match_paren(out_stack, op_stack), }; @@ -349,7 +350,7 @@ fn push_op_to_stack( { loop { match op_stack.last() { - None => return Ok(op_stack.push((token_idx, token.clone()))), + None => { op_stack.push((token_idx, token.clone())); return Ok(()) }, Some(&(_, Token::ParOpen)) => { op_stack.push((token_idx, token.clone())); diff --git a/src/factor/factor.rs b/src/factor/factor.rs index 2f5d5bb2f..b943148f2 100644 --- a/src/factor/factor.rs +++ b/src/factor/factor.rs @@ -154,7 +154,7 @@ fn print_factors(num: u64) { } fn print_factors_str(num_str: &str) { - if let Err(e) = num_str.parse::().and_then(|x| Ok(print_factors(x))) { + if let Err(e) = num_str.parse::().and_then(|x| { print_factors(x); Ok(()) }) { show_warning!("{}: {}", num_str, e); } } diff --git a/src/numfmt/numfmt.rs b/src/numfmt/numfmt.rs index 13d4c54c3..32e3731db 100644 --- a/src/numfmt/numfmt.rs +++ b/src/numfmt/numfmt.rs @@ -276,7 +276,8 @@ fn handle_stdin(options: NumfmtOptions) -> Result<()> { for l in lines { l.map_err(|e| e.to_string()).and_then(|l| { let l = format_string(l, &options)?; - Ok(println!("{}", l)) + println!("{}", l); + Ok(()) })? } Ok(()) diff --git a/src/tee/tee.rs b/src/tee/tee.rs index 7421d69e6..abc77e347 100644 --- a/src/tee/tee.rs +++ b/src/tee/tee.rs @@ -80,7 +80,7 @@ fn options(args: &[String]) -> Result { fn exec(options: Options) -> Result<()> { match options.print_and_exit { - Some(text) => Ok(println!("{}", text)), + Some(text) => { println!("{}", text); Ok(()) }, None => tee(options), } }