Skip to content

Commit

Permalink
Use new async || closure syntax 🎉
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Feb 21, 2025
1 parent 0f9934b commit 800a73d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/download_progress/src/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use iced::task::{Straw, sipper};
use std::sync::Arc;

pub fn download(url: impl AsRef<str>) -> impl Straw<(), Progress, Error> {
sipper(move |mut progress| async move {
sipper(async move |mut progress| {
let response = reqwest::get(url.as_ref()).await?;
let total = response.content_length().ok_or(Error::NoContentLength)?;

Expand Down
2 changes: 1 addition & 1 deletion examples/gallery/src/civitai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl Image {
}

pub fn download(self, size: Size) -> impl Straw<Rgba, Blurhash, Error> {
sipper(move |mut sender| async move {
sipper(async move |mut sender| {
let client = reqwest::Client::new();

if let Size::Thumbnail { width, height } = size {
Expand Down
2 changes: 1 addition & 1 deletion examples/websocket/src/echo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use async_tungstenite::tungstenite;
use std::fmt;

pub fn connect() -> impl Sipper<Never, Event> {
sipper(|mut output| async move {
sipper(async |mut output| {
loop {
const ECHO_SERVER: &str = "ws://127.0.0.1:3030";

Expand Down

0 comments on commit 800a73d

Please sign in to comment.