From b7adb8afaf3ed8a4654c61fb15fe64115e07905e Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Sat, 8 Feb 2020 22:11:37 +0300 Subject: [PATCH] chore: update examples --- examples/diesel/.env | 2 +- examples/diesel/src/db.rs | 2 +- examples/diesel/src/main.rs | 2 +- examples/hyper/src/main.rs | 2 +- examples/rocket/src/main.rs | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/diesel/.env b/examples/diesel/.env index aec4333..5fcb3f1 100644 --- a/examples/diesel/.env +++ b/examples/diesel/.env @@ -1 +1 @@ -DATABASE_URL=postgres://user:test@localhost:5534:5432/db \ No newline at end of file +DATABASE_URL=postgres://user:test@localhost:5534/db \ No newline at end of file diff --git a/examples/diesel/src/db.rs b/examples/diesel/src/db.rs index f216279..0797c4d 100644 --- a/examples/diesel/src/db.rs +++ b/examples/diesel/src/db.rs @@ -4,6 +4,6 @@ use diesel::pg::PgConnection; pub fn establish_connection() -> PgConnection { let database_url = cfg::DATABASE_URL(); - PgConnection::establish(&database_url) + PgConnection::establish(database_url) .expect(&format!("Error connecting to {}", database_url)) } diff --git a/examples/diesel/src/main.rs b/examples/diesel/src/main.rs index 4617ac6..1adc4e6 100644 --- a/examples/diesel/src/main.rs +++ b/examples/diesel/src/main.rs @@ -13,7 +13,7 @@ use crate::models::*; config! { - DATABASE_URL: String, + DATABASE_URL, } diff --git a/examples/hyper/src/main.rs b/examples/hyper/src/main.rs index 95b8d4d..1de774c 100644 --- a/examples/hyper/src/main.rs +++ b/examples/hyper/src/main.rs @@ -18,7 +18,7 @@ config! { PORT => 8000, ), - JSON_API_URL < ( + static JSON_API_URL < ( HYPER_PREFER_SCHEMA, "://", HYPER_HOST, diff --git a/examples/rocket/src/main.rs b/examples/rocket/src/main.rs index eb5b510..c1ad78a 100644 --- a/examples/rocket/src/main.rs +++ b/examples/rocket/src/main.rs @@ -10,7 +10,7 @@ config! { ROCKET { HOST: String => "localhost", PORT: u16 => 9000, - BASE_URL: String => "/", + BASE_URL => "/", } } @@ -24,6 +24,6 @@ fn main() { cfg::init(); rocket::ignite() - .mount(&cfg::ROCKET::BASE_URL(), routes![index]) + .mount(cfg::ROCKET::BASE_URL(), routes![index]) .launch(); } \ No newline at end of file