make sure to borrow in getters

This commit is contained in:
seth 2024-03-30 03:42:53 -04:00
parent 29ed728fc1
commit 1ff95de3bf
No known key found for this signature in database
GPG key ID: D31BD0D494BBEE86
9 changed files with 23 additions and 24 deletions

View file

@ -10,7 +10,7 @@ impl Config {
Self { redis_url }
}
pub fn new_from_env() -> Self {
pub fn from_env() -> Self {
let redis_url = std::env::var("BOT_REDIS_URL").ok();
if let Some(url) = &redis_url {
@ -22,7 +22,7 @@ impl Config {
Self::new(redis_url)
}
pub fn redis_url(self) -> Option<String> {
self.redis_url
pub fn redis_url(&self) -> Option<&str> {
self.redis_url.as_deref()
}
}