Commit e3668c14 authored by Aljaž Srebrnič's avatar Aljaž Srebrnič

Reorder/optimize use calls

parent 62e81714
use std::time::Duration;
use std::env::var;
extern crate spaceapi_server;
#[macro_use] extern crate log;
extern crate env_logger;
extern crate spaceapi_server;
extern crate r2d2_redis;
use spaceapi_server::SpaceapiServerBuilder;
......@@ -10,14 +12,10 @@ use spaceapi_server::api;
use spaceapi_server::api::Keymaster;
use spaceapi_server::modifiers::StatusModifier;
use std::env::var;
use r2d2;
use r2d2_redis::RedisConnectionManager;
use redis;
use redis::{Commands, RedisResult};
type RedisPool = r2d2::Pool<RedisConnectionManager>;
type RedisPool = r2d2::Pool<r2d2_redis::RedisConnectionManager>;
struct OpenStatusFromRedisModifier {
pool: RedisPool
......@@ -111,7 +109,7 @@ fn main() {
.expect("Creating status failed");
let redis_connstring = var("REDIS_CONNSTRING").unwrap_or(String::from("redis://localhost"));
let manager = RedisConnectionManager::new(&*redis_connstring).unwrap();
let manager = r2d2_redis::RedisConnectionManager::new(&*redis_connstring).unwrap();
let pool = RedisPool::builder()
.connection_timeout(Duration::from_secs(1))
.build(manager)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment