cargo fmt fixups

This commit is contained in:
Rob Walker
2018-08-03 11:27:44 -07:00
committed by Michael Vines
parent 3e36e6dcf8
commit f2b1a04bca
8 changed files with 55 additions and 28 deletions

View File

@ -168,7 +168,8 @@ impl<T: Default> Clone for Recycler<T> {
impl<T: Default> Recycler<T> {
pub fn allocate(&self) -> Arc<RwLock<T>> {
let mut gc = self.gc.lock().expect("recycler lock in pb fn allocate");
let x = gc.pop()
let x = gc
.pop()
.unwrap_or_else(|| Arc::new(RwLock::new(Default::default())));
// Only return the item if this recycler is the last reference to it.