Change establish_connection to use &str as opposed to &String
This commit is contained in:
parent
6671f81a9a
commit
f2107568f0
@ -20,8 +20,8 @@ pub mod models;
|
|||||||
|
|
||||||
pub const MIGRATIONS: EmbeddedMigrations = embed_migrations!("./migrations");
|
pub const MIGRATIONS: EmbeddedMigrations = embed_migrations!("./migrations");
|
||||||
|
|
||||||
pub fn establish_connection(database_url: &String) -> Result<PgConnection, Box<dyn error::Error>> {
|
pub fn establish_connection(database_url: &str) -> Result<PgConnection, Box<dyn error::Error>> {
|
||||||
Ok(PgConnection::establish(&database_url)?)
|
Ok(PgConnection::establish(database_url)?)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn run_migrations(
|
pub fn run_migrations(
|
||||||
|
Loading…
Reference in New Issue
Block a user