From 04bd5cf8c48d3b59850350e2a4abba7971a87d48 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sun, 3 Nov 2024 01:30:49 -0400 Subject: [PATCH] Fix async fn in trait warning --- crates/compute_graph/src/rule.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/compute_graph/src/rule.rs b/crates/compute_graph/src/rule.rs index 45377b1..9a95971 100644 --- a/crates/compute_graph/src/rule.rs +++ b/crates/compute_graph/src/rule.rs @@ -2,6 +2,7 @@ use crate::node::NodeValue; use crate::NodeId; pub use compute_graph_macros::InputVisitable; use std::cell::{Ref, RefCell}; +use std::future::Future; use std::ops::Deref; use std::rc::Rc; @@ -62,7 +63,7 @@ pub trait AsyncRule: InputVisitable + 'static { /// Asynchronously produces the value of this rule using its inputs. /// /// See [`Rule::evaluate`] for additional details; the same considerations apply. - async fn evaluate(&mut self) -> Self::Output; + fn evaluate(&mut self) -> impl Future + '_; } /// Common supertrait of [`Rule`] and [`AsyncRule`] that defines how rule inputs are visited.