@@ -182,26 +182,24 @@ mod tests {
182182 #[ tokio:: test]
183183 async fn top_crates ( ) -> Result < ( ) , Error > {
184184 let test_db = TestDatabase :: new ( ) ;
185- let mut conn = test_db. connect ( ) ;
186- let mut async_conn = test_db. async_connect ( ) . await ;
185+ let mut conn = test_db. async_connect ( ) . await ;
187186
188187 // Set up two users.
189- let user_a = faker:: user ( & mut conn, "a" ) ?;
190- let user_b = faker:: user ( & mut conn, "b" ) ?;
188+ let user_a = faker:: user ( & mut conn, "a" ) . await ?;
189+ let user_b = faker:: user ( & mut conn, "b" ) . await ?;
191190
192191 // Set up three crates with various ownership schemes.
193- let _top_a = faker:: crate_and_version ( & mut async_conn , "a" , "Hello" , & user_a, 2 ) . await ?;
192+ let _top_a = faker:: crate_and_version ( & mut conn , "a" , "Hello" , & user_a, 2 ) . await ?;
194193 let top_b =
195- faker:: crate_and_version ( & mut async_conn, "b" , "Yes, this is dog" , & user_b, 1 ) . await ?;
196- let not_top_c =
197- faker:: crate_and_version ( & mut async_conn, "c" , "Unpopular" , & user_a, 0 ) . await ?;
194+ faker:: crate_and_version ( & mut conn, "b" , "Yes, this is dog" , & user_b, 1 ) . await ?;
195+ let not_top_c = faker:: crate_and_version ( & mut conn, "c" , "Unpopular" , & user_a, 0 ) . await ?;
198196
199197 // Let's set up a team that owns both b and c, but not a.
200- let not_the_a_team = faker:: team ( & mut async_conn , "org" , "team" ) . await ?;
201- add_team_to_crate ( & not_the_a_team, & top_b, & user_b, & mut async_conn ) . await ?;
202- add_team_to_crate ( & not_the_a_team, & not_top_c, & user_b, & mut async_conn ) . await ?;
198+ let not_the_a_team = faker:: team ( & mut conn , "org" , "team" ) . await ?;
199+ add_team_to_crate ( & not_the_a_team, & top_b, & user_b, & mut conn ) . await ?;
200+ add_team_to_crate ( & not_the_a_team, & not_top_c, & user_b, & mut conn ) . await ?;
203201
204- let top_crates = TopCrates :: new ( & mut async_conn , 2 ) . await ?;
202+ let top_crates = TopCrates :: new ( & mut conn , 2 ) . await ?;
205203
206204 // Let's ensure the top crates include what we expect (which is a and b, since we asked for
207205 // 2 crates and they're the most downloaded).
@@ -215,7 +213,7 @@ mod tests {
215213 assert ! ( !pkg_a. shared_authors( pkg_b. authors( ) ) ) ;
216214
217215 // Now let's go get package c and pretend it's a new package.
218- let pkg_c = Crate :: from_name ( & mut async_conn , "c" ) . await ?;
216+ let pkg_c = Crate :: from_name ( & mut conn , "c" ) . await ?;
219217
220218 // c _does_ have an author in common with a.
221219 assert ! ( pkg_a. shared_authors( pkg_c. authors( ) ) ) ;
0 commit comments