Change establish_connection to use &str as opposed to &String

This commit is contained in:
Luke Harding 2024-05-04 15:17:42 -04:00
parent 6671f81a9a
commit f2107568f0

View File

@ -20,8 +20,8 @@ pub mod models;
pub const MIGRATIONS: EmbeddedMigrations = embed_migrations!("./migrations");
pub fn establish_connection(database_url: &String) -> Result<PgConnection, Box<dyn error::Error>> {
Ok(PgConnection::establish(&database_url)?)
pub fn establish_connection(database_url: &str) -> Result<PgConnection, Box<dyn error::Error>> {
Ok(PgConnection::establish(database_url)?)
}
pub fn run_migrations(