Skip to content

Commit b6e3af4

Browse files
bors[bot]blckngm
andauthored
Merge #89
89: main: use eprintln instead of eprint r=sopium a=sopium Co-authored-by: Guanhao Yin <[email protected]>
2 parents 7360d75 + 7e6016e commit b6e3af4

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

src/main.rs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ fn main() {
7070
.expect("set_service_status");
7171

7272
real_main(Some(stop_rx)).unwrap_or_else(|e| {
73-
eprint!("Error: {:?}", e);
73+
eprintln!("Error: {:?}", e);
7474
std::process::exit(1);
7575
});
7676

@@ -198,15 +198,11 @@ fn main() {
198198
loop {
199199
line.clear();
200200
match log_pipe.read_line(&mut line).await {
201-
Err(e) => {
202-
break if false {
203-
/* help type inference */
204-
Ok(())
205-
} else {
206-
Err(e)
207-
};
208-
}
201+
Err(e) => break Err(e),
209202
Ok(_) => {
203+
if line.is_empty() {
204+
break Ok(());
205+
}
210206
let line = format!(">>> {}", line);
211207
let _ = stderr.write_all(line.as_bytes()).await;
212208
}
@@ -243,7 +239,7 @@ fn main() {
243239
{
244240
// This process is not running as a service. Create a service and start it.
245241
maybe_run_as_service().unwrap_or_else(|e| {
246-
eprint!("Error: {:?}", e);
242+
eprintln!("Error: {:?}", e);
247243
});
248244
}
249245
_ => {
@@ -257,7 +253,7 @@ fn main() {
257253
#[cfg(not(windows))]
258254
fn main() {
259255
real_main(None).unwrap_or_else(|e| {
260-
eprint!("Error: {:?}", e);
256+
eprintln!("Error: {:?}", e);
261257
std::process::exit(1);
262258
});
263259
}

0 commit comments

Comments
 (0)