Skip to content

Commit db2f11c

Browse files
committed
boot/categories: Merge import blocks
1 parent b0da856 commit db2f11c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/boot/categories.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
// Sync available crate categories from `src/categories.toml`.
22
// Runs when the server is started.
33

4-
use crate::util::diesel::prelude::*;
54
use anyhow::{Context, Result};
5+
use crates_io_database::schema::categories;
6+
use diesel::pg::upsert::excluded;
7+
use diesel::prelude::*;
68
use diesel_async::scoped_futures::ScopedFutureExt;
7-
use diesel_async::{AsyncConnection, AsyncPgConnection};
9+
use diesel_async::{AsyncConnection, AsyncPgConnection, RunQueryDsl};
810

911
#[derive(Debug)]
1012
struct Category {
@@ -78,10 +80,6 @@ fn categories_from_toml(
7880
}
7981

8082
pub 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

0 commit comments

Comments
 (0)