Skip to content

Commit 1aa9581

Browse files
committed
Update input_events example
1 parent c926b6b commit 1aa9581

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lighthouse-client/examples/input_events.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
use clap::Parser;
22
use futures::StreamExt;
33
use lighthouse_client::{protocol::Authentication, Lighthouse, Result, TokioWebSocket, LIGHTHOUSE_URL};
4-
use lighthouse_protocol::Model;
54
use tracing::info;
65

76
async fn run(lh: Lighthouse<TokioWebSocket>) -> Result<()> {
87
info!("Connected to the Lighthouse server");
98

109
// Stream input events
11-
let mut stream = lh.stream_model().await?;
10+
let mut stream = lh.stream_input().await?;
1211
while let Some(msg) = stream.next().await {
13-
if let Model::InputEvent(event) = msg?.payload {
14-
info!("Got input event: {:?}", event)
15-
}
12+
let event = msg?.payload;
13+
info!("Got input event: {:?}", event);
1614
}
1715

1816
Ok(())

0 commit comments

Comments
 (0)