Skip to content

Commit 3667d94

Browse files
committed
Removed unused diesel imports
1 parent fd38621 commit 3667d94

File tree

2 files changed

+1
-13
lines changed

2 files changed

+1
-13
lines changed

Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@ reqwest = { version = "0.11", features = ["json"] }
1313
tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] }
1414
tracing = "0.1"
1515
tracing-subscriber = { version = "0.3" }
16-
diesel = { version = "1.4.0", features = ["postgres", "r2d2"] }
16+
diesel = { version = "1.4.0", features = ["postgres"] }
1717
diesel_migrations = { version = "1.4.0", features = ["postgres"] }
1818
serde = "1.0"
1919
serde_derive = "1.0"
20-
lazy_static = "1.4.0"
2120
envy = "0.4"
2221
indexmap = "1.6"
2322

src/db.rs

-11
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,7 @@
11
use crate::Error;
22
use diesel::prelude::*;
3-
use diesel::r2d2;
4-
use lazy_static::lazy_static;
53
use tracing::info;
64

7-
type Pool = r2d2::Pool<r2d2::ConnectionManager<PgConnection>>;
8-
9-
lazy_static! {
10-
pub static ref DB: Pool = Pool::new(r2d2::ConnectionManager::<PgConnection>::new(
11-
&std::env::var("DATABASE_URL").expect("DATABASE_URL not set")
12-
))
13-
.expect("Unable to connect to database");
14-
}
15-
165
pub fn run_migrations() -> Result<(), Error> {
176
let conn = PgConnection::establish(&std::env::var("DATABASE_URL")?)?;
187

0 commit comments

Comments
 (0)