From d9c9d4ab369c09dae378cb886b9dc7409f114c8f Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Sat, 2 Jul 2016 16:50:11 -0400 Subject: [PATCH] Only allocate a `HashMap` if we need to. --- components/util/prefs.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/util/prefs.rs b/components/util/prefs.rs index a197a1544c6..d0d96a93035 100644 --- a/components/util/prefs.rs +++ b/components/util/prefs.rs @@ -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))) }; }