Debian Codegraph @

testdata/partial-refine.riff-output

raw
1 diff --git a/xsrc/main.rs b/xsrc/main.rs
2 index 55a7c18..8826249 100644
3 --- a/xsrc/main.rs
4 +++ b/xsrc/main.rs
5 @@ -90,7 +91,15 @@ fn get_fixed_highlight(line: &str) -> &str {
6 }
7
8 fn print(stream: &mut BufWriter<&mut dyn Write>, text: &str) {
9 - stream.write_all(text.as_bytes()).unwrap();
10 + if let Err(error) = stream.write_all(text.as_bytes()) {
11 + if error.kind() == ErrorKind::BrokenPipe {
12 + // This is fine, somebody probably just quit their pager before it
13 + // was done reading our output.
14 + exit(0);
15 + }
16 +
17 + panic!("Error writing diff to pager: {:?}", error);
18 + }
19 }
20
21 fn println(stream: &mut BufWriter<&mut dyn Write>, text: &str) {