Skip to content

Commit

Permalink
fix: remove conditional send for TestEnv
Browse files Browse the repository at this point in the history
Signed-off-by: Lachezar Lechev <[email protected]>
  • Loading branch information
elpiel committed Jan 13, 2023
1 parent 82b194d commit 27b664b
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions src/unit_tests/env.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use crate::models::ctx::Ctx;
use crate::models::streaming_server::StreamingServer;
use crate::runtime::{
ConditionalSend, Env, EnvFuture, EnvFutureExt, Model, Runtime, RuntimeEvent, TryEnvFuture,
};
use crate::runtime::{Env, EnvFuture, EnvFutureExt, Model, Runtime, RuntimeEvent, TryEnvFuture};
use chrono::{DateTime, Utc};
use enclose::enclose;
use futures::channel::mpsc::Receiver;
Expand Down Expand Up @@ -106,10 +104,7 @@ impl TestEnv {
}

impl Env for TestEnv {
fn fetch<
IN: Serialize + ConditionalSend + 'static,
OUT: for<'de> Deserialize<'de> + ConditionalSend + 'static,
>(
fn fetch<IN: Serialize + 'static, OUT: for<'de> Deserialize<'de> + 'static>(
request: http::Request<IN>,
) -> TryEnvFuture<OUT> {
let request = Request::from(request);
Expand All @@ -122,9 +117,7 @@ impl Env for TestEnv {
})
.boxed_env()
}
fn get_storage<T: for<'de> Deserialize<'de> + ConditionalSend + 'static>(
key: &str,
) -> TryEnvFuture<Option<T>> {
fn get_storage<T: for<'de> Deserialize<'de> + 'static>(key: &str) -> TryEnvFuture<Option<T>> {
future::ok(
STORAGE
.read()
Expand All @@ -142,10 +135,10 @@ impl Env for TestEnv {
};
future::ok(()).boxed_env()
}
fn exec_concurrent<F: Future<Output = ()> + ConditionalSend + 'static>(future: F) {
fn exec_concurrent<F: Future<Output = ()> + 'static>(future: F) {
tokio_current_thread::spawn(future);
}
fn exec_sequential<F: Future<Output = ()> + ConditionalSend + 'static>(future: F) {
fn exec_sequential<F: Future<Output = ()> + 'static>(future: F) {
tokio_current_thread::spawn(future);
}
fn now() -> DateTime<Utc> {
Expand Down

0 comments on commit 27b664b

Please sign in to comment.