From 7d03ea4b3403d8570d9dd76e251fbbb6f43a4d16 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Thu, 29 Jan 2026 11:08:21 -0600 Subject: [PATCH] move get_pages to a non async function --- src/ui/presentation_editor.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/ui/presentation_editor.rs b/src/ui/presentation_editor.rs index e19b337..9c50c72 100644 --- a/src/ui/presentation_editor.rs +++ b/src/ui/presentation_editor.rs @@ -106,16 +106,16 @@ impl PresentationEditor { ending_index, } = presentation.kind.clone() { + let range = starting_index..=ending_index; + let path = presentation.path.clone(); task = Task::perform( - get_pages( - starting_index..=ending_index, - presentation.path.clone(), - ), + async move { get_pages(range, path) }, Message::AddSlides, ); } else { + let path = presentation.path.clone(); task = Task::perform( - get_pages(.., presentation.path.clone()), + async move { get_pages(.., path) }, Message::AddSlides, ); } @@ -172,16 +172,16 @@ impl PresentationEditor { ending_index, } = presentation.kind.clone() { + let range = starting_index..=ending_index; + let path = presentation.path.clone(); task = Task::perform( - get_pages( - starting_index..=ending_index, - presentation.path.clone(), - ), + async move { get_pages(range, path) }, Message::AddSlides, ); } else { + let path = presentation.path.clone(); task = Task::perform( - get_pages(.., presentation.path.clone()), + async move { get_pages(.., path) }, Message::AddSlides, ); } @@ -607,7 +607,7 @@ impl Default for PresentationEditor { } } -async fn get_pages( +fn get_pages( range: impl RangeBounds, presentation_path: impl AsRef, ) -> Option> {