Only allocate a HashMap if we need to.

This commit is contained in:
Corey Farwell 2016-07-02 16:50:11 -04:00
parent 22928f50ac
commit d9c9d4ab36

View file

@ -15,7 +15,7 @@ use std::sync::{Arc, Mutex};
lazy_static! {
pub static ref PREFS: Preferences = {
let prefs = read_prefs().unwrap_or(HashMap::new());
let prefs = read_prefs().unwrap_or_else(|_| HashMap::new());
Preferences(Arc::new(Mutex::new(prefs)))
};
}