Skip to content

Commit

Permalink
cakebaker suggestion for a better code #5845 #5852
Browse files Browse the repository at this point in the history
  • Loading branch information
biplab5464 committed Jan 23, 2024
1 parent 12a5b5a commit 5721a14
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/uu/unexpand/src/unexpand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ fn open(path: &str) -> UResult<BufReader<Box<dyn Read + 'static>>> {
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<dyn Read>))
Expand Down
6 changes: 3 additions & 3 deletions tests/by-util/test_unexpand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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");
}

0 comments on commit 5721a14

Please sign in to comment.