Skip to content

Commit

Permalink
Don't panic on invalid utf-8 input data
Browse files Browse the repository at this point in the history
Fixes #150, #187
  • Loading branch information
dandavison committed May 11, 2020
1 parent bd30692 commit 9d1aafe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ fn main() -> std::io::Result<()> {
let mut writer = output_type.handle().unwrap();

if let Err(error) = delta(
io::stdin().lock().lines().map(|l| l.unwrap()),
io::stdin()
.lock()
.lines()
.map(|l| l.unwrap_or_else(|_| "<delta: invalid utf-8 data>".to_string())),
&config,
&assets,
&mut writer,
Expand Down

0 comments on commit 9d1aafe

Please sign in to comment.