mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-25 19:03:30 +04:00
examples: continue handling output events
This commit is contained in:
parent
279db98d3c
commit
6c0f7eafc3
@ -11,13 +11,15 @@ struct LaunchArguments {
|
||||
}
|
||||
|
||||
async fn output(mut output_event: Receiver<Event>) {
|
||||
let body: OutputEventBody =
|
||||
from_value(output_event.recv().await.unwrap().body.unwrap()).unwrap();
|
||||
println!(
|
||||
"> [{}] {}",
|
||||
body.category.unwrap_or("unknown".to_owned()),
|
||||
body.output
|
||||
);
|
||||
loop {
|
||||
let body: OutputEventBody =
|
||||
from_value(output_event.recv().await.unwrap().body.unwrap()).unwrap();
|
||||
println!(
|
||||
"> [{}] {}",
|
||||
body.category.unwrap_or("unknown".to_owned()),
|
||||
body.output
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
|
@ -11,13 +11,15 @@ struct LaunchArguments {
|
||||
}
|
||||
|
||||
async fn output(mut output_event: Receiver<Event>) {
|
||||
let body: OutputEventBody =
|
||||
from_value(output_event.recv().await.unwrap().body.unwrap()).unwrap();
|
||||
println!(
|
||||
"> [{}] {}",
|
||||
body.category.unwrap_or("unknown".to_owned()),
|
||||
body.output
|
||||
);
|
||||
loop {
|
||||
let body: OutputEventBody =
|
||||
from_value(output_event.recv().await.unwrap().body.unwrap()).unwrap();
|
||||
println!(
|
||||
"> [{}] {}",
|
||||
body.category.unwrap_or("unknown".to_owned()),
|
||||
body.output
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
|
Loading…
Reference in New Issue
Block a user