Skip to content

Commit 102e9a2

Browse files
committed
update tests/lib.rs to compile
1 parent 866b7b5 commit 102e9a2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
use diesel::prelude::{ExpressionMethods, OptionalExtension, QueryDsl};
22
use diesel::QueryResult;
33
use diesel_async::*;
4-
use futures::FutureExt;
4+
use scoped_futures::ScopedFutureExt;
55
use std::fmt::Debug;
6-
use std::pin::Pin;
76

87
#[cfg(feature = "postgres")]
98
mod custom_types;
@@ -12,7 +11,7 @@ mod type_check;
1211
async fn transaction_test(conn: &mut TestConnection) -> QueryResult<()> {
1312
let res = conn
1413
.transaction::<i32, diesel::result::Error, _>(|conn| {
15-
Box::pin(async move {
14+
async move {
1615
let users: Vec<User> = users::table.load(conn).await?;
1716
assert_eq!(&users[0].name, "John Doe");
1817
assert_eq!(&users[1].name, "Jane Doe");
@@ -31,7 +30,7 @@ async fn transaction_test(conn: &mut TestConnection) -> QueryResult<()> {
3130
assert_eq!(count, 3);
3231
Ok(())
3332
}
34-
.boxed()
33+
.scope_boxed()
3534
})
3635
.await;
3736
assert!(res.is_ok());
@@ -48,7 +47,8 @@ async fn transaction_test(conn: &mut TestConnection) -> QueryResult<()> {
4847
assert_eq!(count, 4);
4948

5049
Err(diesel::result::Error::RollbackTransaction)
51-
}) as Pin<Box<_>>
50+
}
51+
.scope_boxed()
5252
})
5353
.await;
5454
assert_eq!(

0 commit comments

Comments
 (0)