From 5721a1407787ad48485975a5e42f0ed8d5f1b79b Mon Sep 17 00:00:00 2001 From: biplab5464 Date: Tue, 23 Jan 2024 22:17:06 +0530 Subject: [PATCH] cakebaker suggestion for a better code #5845 #5852 --- src/uu/unexpand/src/unexpand.rs | 2 +- tests/by-util/test_unexpand.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/uu/unexpand/src/unexpand.rs b/src/uu/unexpand/src/unexpand.rs index 4eaf9d07f4..7336376eb6 100644 --- a/src/uu/unexpand/src/unexpand.rs +++ b/src/uu/unexpand/src/unexpand.rs @@ -216,7 +216,7 @@ fn open(path: &str) -> UResult>> { if filename.is_dir() { Err(Box::new(USimpleError { code: 1, - message: format!("unexpand: {}: Is a directory", filename.display()), + message: format!("{}: Is a directory", filename.display()), })) } else if path == "-" { Ok(BufReader::new(Box::new(stdin()) as Box)) diff --git a/tests/by-util/test_unexpand.rs b/tests/by-util/test_unexpand.rs index 087a2a1756..c1310be01a 100644 --- a/tests/by-util/test_unexpand.rs +++ b/tests/by-util/test_unexpand.rs @@ -2,6 +2,7 @@ // // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. +// spell-checker:ignore contenta use crate::common::util::TestScenario; #[test] @@ -261,9 +262,8 @@ fn test_multiple_files() { #[test] fn test_one_nonexisting_file() { - let (at, mut ucmd) = at_and_ucmd!(); - - ucmd.arg("asdf.txt") + new_ucmd!() + .arg("asdf.txt") .fails() .stderr_contains("asdf.txt: No such file or directory"); }