diff options
Diffstat (limited to 'src/db/mod.rs')
| -rw-r--r-- | src/db/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/db/mod.rs b/src/db/mod.rs index 94953d5..e7ff17f 100644 --- a/src/db/mod.rs +++ b/src/db/mod.rs @@ -47,7 +47,7 @@ static MIGRATE: std::sync::Once = std::sync::Once::new(); lazy_static! { static ref DB_URL: String = - env::var("DATABASE_URL").expect("no database url in environment").into(); + env::var("DATABASE_URL").expect("no database url in environment"); static ref DB_CONFIG: Config = Config::from_str(&DB_URL).expect("parsing db url as config"); static ref CONN_MGR: ConnectionManager<PgConnection> = ConnectionManager::new(DB_URL.clone()); static ref RAW_CONN_MGR: RawPgConnMgr<NoTls> = RawPgConnMgr::new(DB_CONFIG.clone(), NoTls); @@ -236,7 +236,7 @@ pub fn rare_meme(conn: &mut PgConnection, audio: bool) -> Result<Meme> { .map(|row| (row.get::<_, i32>(0), row.get::<_, f64>(1) as i64)) .collect::<Vec<_>>(); - if elems.len() == 0 { + if elems.is_empty() { return Err(anyhow!("no rare memes found")); } |
