From 91af1c5ed65d75d9da62d29254460b5ed79f96eb Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 21 Feb 2025 01:28:47 +0100 Subject: Update all `examples` to Rust 2024 --- examples/websocket/src/echo.rs | 2 +- examples/websocket/src/echo/server.rs | 2 +- examples/websocket/src/main.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/websocket/src') diff --git a/examples/websocket/src/echo.rs b/examples/websocket/src/echo.rs index 149a260c..0f14af94 100644 --- a/examples/websocket/src/echo.rs +++ b/examples/websocket/src/echo.rs @@ -1,7 +1,7 @@ pub mod server; use iced::futures; -use iced::task::{sipper, Never, Sipper}; +use iced::task::{Never, Sipper, sipper}; use iced::widget::text; use futures::channel::mpsc; diff --git a/examples/websocket/src/echo/server.rs b/examples/websocket/src/echo/server.rs index a696a7a4..1bb313b4 100644 --- a/examples/websocket/src/echo/server.rs +++ b/examples/websocket/src/echo/server.rs @@ -2,8 +2,8 @@ use iced::futures; use futures::channel::mpsc; use futures::{SinkExt, StreamExt}; -use warp::ws::WebSocket; use warp::Filter; +use warp::ws::WebSocket; // Basic WebSocket echo server adapted from: // https://github.com/seanmonstar/warp/blob/3ff2eaf41eb5ac9321620e5a6434d5b5ec6f313f/examples/websockets_chat.rs diff --git a/examples/websocket/src/main.rs b/examples/websocket/src/main.rs index ae658471..b918c479 100644 --- a/examples/websocket/src/main.rs +++ b/examples/websocket/src/main.rs @@ -3,7 +3,7 @@ mod echo; use iced::widget::{ self, button, center, column, row, scrollable, text, text_input, }; -use iced::{color, Center, Element, Fill, Subscription, Task}; +use iced::{Center, Element, Fill, Subscription, Task, color}; use std::sync::LazyLock; pub fn main() -> iced::Result { -- cgit From 800a73ddd7d4a2e0b1ed23ec565cbc6325b3b7f0 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 21 Feb 2025 02:01:42 +0100 Subject: Use new `async ||` closure syntax :tada: --- examples/websocket/src/echo.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/websocket/src') diff --git a/examples/websocket/src/echo.rs b/examples/websocket/src/echo.rs index 0f14af94..1116d1ea 100644 --- a/examples/websocket/src/echo.rs +++ b/examples/websocket/src/echo.rs @@ -12,7 +12,7 @@ use async_tungstenite::tungstenite; use std::fmt; pub fn connect() -> impl Sipper { - sipper(|mut output| async move { + sipper(async |mut output| { loop { const ECHO_SERVER: &str = "ws://127.0.0.1:3030"; -- cgit