File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
1
use diesel:: prelude:: { ExpressionMethods , OptionalExtension , QueryDsl } ;
2
2
use diesel:: QueryResult ;
3
3
use diesel_async:: * ;
4
- use futures :: FutureExt ;
4
+ use scoped_futures :: ScopedFutureExt ;
5
5
use std:: fmt:: Debug ;
6
- use std:: pin:: Pin ;
7
6
8
7
#[ cfg( feature = "postgres" ) ]
9
8
mod custom_types;
@@ -12,7 +11,7 @@ mod type_check;
12
11
async fn transaction_test ( conn : & mut TestConnection ) -> QueryResult < ( ) > {
13
12
let res = conn
14
13
. transaction :: < i32 , diesel:: result:: Error , _ > ( |conn| {
15
- Box :: pin ( async move {
14
+ async move {
16
15
let users: Vec < User > = users:: table. load ( conn) . await ?;
17
16
assert_eq ! ( & users[ 0 ] . name, "John Doe" ) ;
18
17
assert_eq ! ( & users[ 1 ] . name, "Jane Doe" ) ;
@@ -31,7 +30,7 @@ async fn transaction_test(conn: &mut TestConnection) -> QueryResult<()> {
31
30
assert_eq ! ( count, 3 ) ;
32
31
Ok ( ( ) )
33
32
}
34
- . boxed ( )
33
+ . scope_boxed ( )
35
34
} )
36
35
. await ;
37
36
assert ! ( res. is_ok( ) ) ;
@@ -48,7 +47,8 @@ async fn transaction_test(conn: &mut TestConnection) -> QueryResult<()> {
48
47
assert_eq ! ( count, 4 ) ;
49
48
50
49
Err ( diesel:: result:: Error :: RollbackTransaction )
51
- } ) as Pin < Box < _ > >
50
+ }
51
+ . scope_boxed ( )
52
52
} )
53
53
. await ;
54
54
assert_eq ! (
You can’t perform that action at this time.
0 commit comments