Skip to content

Commit 259d028

Browse files
Merge #906
906: Remove dead code r=carols10cents I noticed we had a bunch of functions which weren't being used anymore. I've taken the liberty of deleting them. It was pretty easy. :trollface: (Note: This includes all my other open Diesel PRs, only the last commit and the deleted binary commits are actually new. I'll rebase this once those are all merged, but yes we really are done)
2 parents d6eaeb8 + 32b449b commit 259d028

21 files changed

+24
-1319
lines changed

Cargo.lock

Lines changed: 0 additions & 253 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ flate2 = "0.2"
2828
semver = "0.5"
2929
url = "1.2.1"
3030

31-
postgres = { version = "0.14.0", features = ["with-time", "with-openssl", "with-serde_json", "with-chrono"] }
3231
r2d2 = "0.7.0"
33-
r2d2_postgres = "0.12.0"
3432
openssl = "0.9.9"
3533
curl = "0.4"
3634
oauth2 = "0.3"
@@ -73,6 +71,3 @@ diesel = { version = "0.15.0", features = ["postgres"] }
7371
[features]
7472
unstable = []
7573
lint = ["clippy"]
76-
77-
[replace]
78-
"postgres:0.14.2" = { git = "https://github.com/sfackler/rust-postgres.git" }

src/app.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ use {db, Config};
2020
#[allow(missing_debug_implementations)]
2121
pub struct App {
2222
/// The database connection pool
23-
pub database: db::Pool,
24-
25-
/// The diesel database connection pool
2623
pub diesel_database: db::DieselPool,
2724

2825
/// The GitHub OAuth2 configuration
@@ -83,12 +80,6 @@ impl App {
8380
_ => 1,
8481
};
8582

86-
// We need two connection pools until we finish transitioning everything to use diesel.
87-
let db_config = r2d2::Config::builder()
88-
.pool_size(db_pool_size)
89-
.min_idle(db_min_idle)
90-
.helper_threads(db_helper_threads)
91-
.build();
9283
let diesel_db_config = r2d2::Config::builder()
9384
.pool_size(db_pool_size)
9485
.min_idle(db_min_idle)
@@ -98,7 +89,6 @@ impl App {
9889
let repo = git2::Repository::open(&config.git_repo_checkout).unwrap();
9990

10091
App {
101-
database: db::pool(&config.db_url, db_config),
10292
diesel_database: db::diesel_pool(&config.db_url, diesel_db_config),
10393
github: github,
10494
session_key: config.session_key.clone(),

src/bin/fill-in-user-id.rs

Lines changed: 0 additions & 94 deletions
This file was deleted.

src/bin/update-licenses.rs

Lines changed: 0 additions & 65 deletions
This file was deleted.

src/category.rs

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@ use conduit::{Request, Response};
44
use conduit_router::RequestParams;
55
use diesel::*;
66
use diesel::pg::PgConnection;
7-
use pg::rows::Row;
87

8+
use Crate;
99
use db::RequestTransaction;
1010
use schema::*;
1111
use util::{RequestUtils, CargoResult};
12-
use {Model, Crate};
1312

1413
#[derive(Clone, Identifiable, Queryable, Debug)]
1514
#[table_name = "categories"]
@@ -186,22 +185,6 @@ impl<'a> NewCategory<'a> {
186185
}
187186
}
188187

189-
impl Model for Category {
190-
fn from_row(row: &Row) -> Category {
191-
Category {
192-
id: row.get("id"),
193-
created_at: row.get("created_at"),
194-
crates_cnt: row.get("crates_cnt"),
195-
category: row.get("category"),
196-
slug: row.get("slug"),
197-
description: row.get("description"),
198-
}
199-
}
200-
fn table_name(_: Option<Category>) -> &'static str {
201-
"categories"
202-
}
203-
}
204-
205188
/// Handles the `GET /categories` route.
206189
pub fn index(req: &mut Request) -> CargoResult<Response> {
207190
let conn = req.db_conn()?;

0 commit comments

Comments
 (0)