diff --git a/x11rb-async/examples/shared_memory_async.rs b/x11rb-async/examples/shared_memory_async.rs index 9a4d9e9f..f0440ba3 100644 --- a/x11rb-async/examples/shared_memory_async.rs +++ b/x11rb-async/examples/shared_memory_async.rs @@ -160,8 +160,9 @@ async fn main2(file: File) -> Result<(), Box> { async move { // Spawn a task to read from the connection. ex.spawn(async move { - if let Err(e) = drive.await { - tracing::error!("Error while driving the connection: {}", e); + match drive.await { + Err(e) => tracing::error!("Error while driving the connection: {}", e), + _ => unreachable!(), } }) .detach(); diff --git a/x11rb-async/examples/xclock_utc_async.rs b/x11rb-async/examples/xclock_utc_async.rs index 78cdc07e..1f2f5cf8 100644 --- a/x11rb-async/examples/xclock_utc_async.rs +++ b/x11rb-async/examples/xclock_utc_async.rs @@ -240,8 +240,9 @@ async fn main2() -> Result<(), Box> { async move { // Spawn a task to poll for events. let driver = ex.spawn(async move { - if let Err(e) = drive.await { - tracing::error!("Error while driving the connection: {}", e); + match drive.await { + Err(e) => tracing::error!("Error while driving the connection: {}", e), + _ => unreachable!(), } });