From 1aa9581806d9cbb523d5a52c6214d327b361c65f Mon Sep 17 00:00:00 2001 From: fwcd Date: Sun, 23 Mar 2025 02:07:47 +0100 Subject: [PATCH] Update input_events example --- lighthouse-client/examples/input_events.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lighthouse-client/examples/input_events.rs b/lighthouse-client/examples/input_events.rs index 52720a8..7db6cdf 100644 --- a/lighthouse-client/examples/input_events.rs +++ b/lighthouse-client/examples/input_events.rs @@ -1,18 +1,16 @@ use clap::Parser; use futures::StreamExt; use lighthouse_client::{protocol::Authentication, Lighthouse, Result, TokioWebSocket, LIGHTHOUSE_URL}; -use lighthouse_protocol::Model; use tracing::info; async fn run(lh: Lighthouse) -> Result<()> { info!("Connected to the Lighthouse server"); // Stream input events - let mut stream = lh.stream_model().await?; + let mut stream = lh.stream_input().await?; while let Some(msg) = stream.next().await { - if let Model::InputEvent(event) = msg?.payload { - info!("Got input event: {:?}", event) - } + let event = msg?.payload; + info!("Got input event: {:?}", event); } Ok(())