Skip to content

Commit 3b8786d

Browse files
committed
fix: non utf-8 char handling
Signed-off-by: wxiwnd <[email protected]>
1 parent bc3143d commit 3b8786d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,12 @@ fn main() {
9292
let stdin = std::io::stdin();
9393
let reader = BufReader::new(stdin.lock());
9494
for line_result in reader.lines() {
95-
let candidate = line_result.unwrap().trim_end().to_string();
95+
let candidate = match line_result {
96+
Ok(line) => line.trim_end().to_string(),
97+
Err(_) => {
98+
continue;
99+
}
100+
};
96101
// Ignore Pure English Path
97102
if is_pure_english_path(&candidate) {
98103
continue;

0 commit comments

Comments
 (0)