Skip to content

Commit 9869942

Browse files
committed
A few small cleanups
1 parent 46c8129 commit 9869942

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

src/admin/migrate.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ pub fn run(_opts: Opts) -> Result<(), Error> {
3939
let conn = &mut crate::db::oneoff_connection_with_config(&config)?;
4040

4141
info!("Migrating the database");
42-
// let migrations = ;
4342
let mut stdout = std::io::stdout();
4443
let mut harness = HarnessWithOutput::new(conn, &mut stdout);
4544
harness

src/models/dependency.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use diesel::deserialize::{self, FromSql};
22
use diesel::pg::Pg;
3-
use diesel::sql_types::Integer;
3+
use diesel::sql_types::{Text, Integer};
44

55
use crate::models::{Crate, Version};
66
use crate::schema::*;
@@ -27,9 +27,9 @@ pub struct Dependency {
2727
pub struct ReverseDependency {
2828
#[diesel(embed)]
2929
pub dependency: Dependency,
30-
#[diesel(sql_type = ::diesel::sql_types::Integer)]
30+
#[diesel(sql_type = Integer)]
3131
pub crate_downloads: i32,
32-
#[diesel(sql_type = ::diesel::sql_types::Text)]
32+
#[diesel(sql_type = Text)]
3333
#[diesel(column_name = crate_name)]
3434
pub name: String,
3535
}

src/models/helpers/with_count.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
use diesel::sql_types::BigInt;
2+
13
#[derive(QueryableByName, Queryable, Debug)]
24
pub struct WithCount<T> {
35
#[diesel(embed)]
46
pub(crate) record: T,
5-
#[diesel(sql_type = ::diesel::sql_types::BigInt)]
7+
#[diesel(sql_type = BigInt)]
68
pub(crate) total: i64,
79
}
810

src/swirl/runner.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ mod tests {
408408

409409
impl<'a> Drop for TestGuard<'a> {
410410
fn drop(&mut self) {
411-
::diesel::sql_query("TRUNCATE TABLE background_jobs")
411+
diesel::sql_query("TRUNCATE TABLE background_jobs")
412412
.execute(&mut *runner().connection().unwrap())
413413
.unwrap();
414414
}
@@ -422,7 +422,7 @@ mod tests {
422422
}
423423

424424
fn create_dummy_job(runner: &Runner) -> storage::BackgroundJob {
425-
::diesel::insert_into(background_jobs)
425+
diesel::insert_into(background_jobs)
426426
.values((job_type.eq("Foo"), data.eq(serde_json::json!(null))))
427427
.returning((id, job_type, data))
428428
.get_result(&mut *runner.connection().unwrap())

0 commit comments

Comments
 (0)