(&self)
| 87 | } |
| 88 | |
| 89 | pub fn get_redis_url(&self) -> Option<String> { |
| 90 | self.redis.as_ref().and_then(|c| { |
| 91 | c.url |
| 92 | .clone() |
| 93 | .map(Into::into) |
| 94 | .or_else(|| match (&c.host, &c.port, &c.password) { |
| 95 | (Some(host), Some(port), Some(password)) => { |
| 96 | Some(format!("redis://:{}@{}:{}", password, host, port)) |
| 97 | } |
| 98 | _ => None, |
| 99 | }) |
| 100 | }) |
| 101 | } |
| 102 | } |
no test coverage detected