Skip to content

Commit

Permalink
feat(lib.rs): implement Default trait for LazyCell
Browse files Browse the repository at this point in the history
  • Loading branch information
indiv0 committed Mar 16, 2016
1 parent fc3b28d commit 150a630
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#![cfg_attr(feature = "clippy", plugin(clippy))]

use std::cell::RefCell;
use std::default::Default;
use std::mem;

/// A lazily filled Cell, with frozen contents.
Expand Down Expand Up @@ -69,3 +70,10 @@ impl<T> LazyCell<T> {
self.inner.into_inner()
}
}

impl<T> Default for LazyCell<T> {
#[inline]
fn default() -> LazyCell<T> {
Self::new()
}
}

0 comments on commit 150a630

Please sign in to comment.