Commit 6cc75a88 authored by Aljaž Srebrnič's avatar Aljaž Srebrnič

Avoid extra variable binding

parent 0c04e67c
use spaceapi_server::api;
use spaceapi_server::modifiers::StatusModifier;
use redis::{Commands, RedisResult};
use redis::Commands;
type RedisPool = r2d2::Pool<r2d2_redis::RedisConnectionManager>;
......@@ -25,8 +25,7 @@ impl StatusModifier for OpenStatusFromRedisModifier {
Ok(c) => c
};
let state : RedisResult<String> = conn.get("state_open");
status.state.open = match state {
status.state.open = match conn.get::<_, String>("state_open") {
Ok(v) => Some(v == "open"),
Err(_) => None
};
......
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