File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 11// Sync available crate categories from `src/categories.toml`.
22// Runs when the server is started.
33
4- use crate :: util:: diesel:: prelude:: * ;
54use anyhow:: { Context , Result } ;
5+ use crates_io_database:: schema:: categories;
6+ use diesel:: pg:: upsert:: excluded;
7+ use diesel:: prelude:: * ;
68use diesel_async:: scoped_futures:: ScopedFutureExt ;
7- use diesel_async:: { AsyncConnection , AsyncPgConnection } ;
9+ use diesel_async:: { AsyncConnection , AsyncPgConnection , RunQueryDsl } ;
810
911#[ derive( Debug ) ]
1012struct Category {
@@ -78,10 +80,6 @@ fn categories_from_toml(
7880}
7981
8082pub async fn sync_with_connection ( toml_str : & str , conn : & mut AsyncPgConnection ) -> Result < ( ) > {
81- use crate :: schema:: categories;
82- use diesel:: pg:: upsert:: excluded;
83- use diesel_async:: RunQueryDsl ;
84-
8583 let toml: toml:: value:: Table =
8684 toml:: from_str ( toml_str) . context ( "Could not parse categories toml" ) ?;
8785
You can’t perform that action at this time.
0 commit comments