Skip to content

Commit 3232c81

Browse files
committed
micro nit
1 parent 804db6d commit 3232c81

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

examples/proxy_object_std.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,8 @@ fn proxy_json_object<Input: Read, Output: Write, Logs: Write>(mut input: Input,
2323
let mut read_buffer_end = 0;
2424
loop {
2525
match input.read(read_buffer.split_at_mut(read_buffer_end).1) {
26-
// Ok(0) => break,
2726
Err(e) => {
28-
// e.error
29-
eprintln!("failed to read from stdin: {:?}", e);
27+
eprintln!("failed to read from input: {:?}", e);
3028
exit(1);
3129
},
3230
Ok(n) => {
@@ -47,7 +45,7 @@ fn proxy_json_object<Input: Read, Output: Write, Logs: Write>(mut input: Input,
4745
Ok((bytes_consumed, json_object)) => {
4846
log_output.write_fmt(format_args!("read {} bytes, parsed a json object in {} bytes with {} fields\n", read_buffer_end, bytes_consumed, json_object.len())).unwrap();
4947
log_output.flush().unwrap();
50-
json_object.serialize(&mut output).unwrap();
48+
json_object.serialize(&mut output).expect("failed to write to output");
5149
break;
5250
},
5351
}

0 commit comments

Comments
 (0)