Skip to content

Commit

Permalink
fix: better example
Browse files Browse the repository at this point in the history
  • Loading branch information
codinaut committed Aug 2, 2020
1 parent 06206c0 commit 87c90e5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
//! # Example
//! ```
//! # tokio::runtime::Runtime::new().unwrap().block_on (async {
//! use lazy_futuristic::{Lazy, ValueOrSetter};
//! use lazy_futuristic::Lazy;
//! use lazy_futuristic::ValueOrSetter::*;
//!
//! let lazy_number: Lazy<i32> = Lazy::new();
//! let number = match lazy_number.get_or_set().await {
//! ValueOrSetter::Value(value) => value,
//! ValueOrSetter::Setter(setter) => setter.set(10),
//! Value(value) => value,
//! Setter(setter) => setter.set(10),
//! };
//!
//! assert_eq!(*number, 10);
Expand Down

0 comments on commit 87c90e5

Please sign in to comment.