Skip to content

Commit

Permalink
Adjust non-UTF-8 error message.
Browse files Browse the repository at this point in the history
This commit came after the "Release 1.0.2" commit but I will include it
in 1.0.2 by cutting the release from this commit.
  • Loading branch information
nnethercote committed Jul 28, 2023
1 parent 3d4c34f commit cb6ec63
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ where
for reader in readers {
for line in reader.lines() {
let Ok(line) = line else {
eprintln!("error: non-UTF-8 input detected");
eprintln!("counts: non-UTF-8 input detected, aborting");
std::process::exit(1);
};
let (line, weight) = get_line_and_weight(line);
Expand Down
2 changes: 1 addition & 1 deletion tests/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ baz 23 - +1
#[test]
fn non_utf8() -> Result<(), Box<dyn std::error::Error>> {
let input = unsafe { std::str::from_utf8_unchecked(&[0x97, 0x98, 0x99, 0xff]) };
let expected_output = "error: non-UTF-8 input detected\n";
let expected_output = "counts: non-UTF-8 input detected, aborting\n";

bad_test(input, expected_output)
}
Expand Down

0 comments on commit cb6ec63

Please sign in to comment.