@@ -182,26 +182,24 @@ mod tests {
182
182
#[ tokio:: test]
183
183
async fn top_crates ( ) -> Result < ( ) , Error > {
184
184
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 ;
187
186
188
187
// 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 ?;
191
190
192
191
// 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 ?;
194
193
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 ?;
198
196
199
197
// 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 ?;
203
201
204
- let top_crates = TopCrates :: new ( & mut async_conn , 2 ) . await ?;
202
+ let top_crates = TopCrates :: new ( & mut conn , 2 ) . await ?;
205
203
206
204
// Let's ensure the top crates include what we expect (which is a and b, since we asked for
207
205
// 2 crates and they're the most downloaded).
@@ -215,7 +213,7 @@ mod tests {
215
213
assert ! ( !pkg_a. shared_authors( pkg_b. authors( ) ) ) ;
216
214
217
215
// 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 ?;
219
217
220
218
// c _does_ have an author in common with a.
221
219
assert ! ( pkg_a. shared_authors( pkg_c. authors( ) ) ) ;
0 commit comments