pub fn map<F, U>(self, f: F) -> Later<U>
    where
        F: Fn(T) -> U + 'static,
        T: Clone + 'static, // TODO get rid of Clone
    {
        if self.cell.filled() {
            Later {
                cell: LazyCell::new(),
                f: Box::new(move || f(self.get().clone())),
            }
        } else {
            Later {
                cell: LazyCell::new(),
                f: Box::new(move || f((self.f)())),
            }
        }
    }
/// Caution: If deferred value has been computed, the value
/// is cloned to create a new Later<T> object!
If deferred value has been computed, the value
is cloned to create a new Later object!
If deferred value has been computed the value is cloned to create a new Later object!
pub fn map<F, U>(self, f: F) -> Later<U>
    where
        F: Fn(T) -> U + 'static,
        T: Clone + 'static, // TODO get rid of Clone
    {
        if self.cell.filled() {
            Later {
                cell: LazyCell::new(),
                f: Box::new(move || f(self.get().clone())),
            }
        } else {
            Later {
                cell: LazyCell::new(),
                f: Box::new(move || f((self.f)())),
            }
        }
    }
pub fn map < F , U > ( self , f : F ) -> Later < U > where F : Fn ( T ) -> U + ' static , T : Clone + ' static , // TODO get rid of Clone { if self . cell . filled ( ) { Later { cell : LazyCell :: new ( ) , f : Box :: new ( move | | f ( self . get ( ) . clone ( ) ) ) , } } else { Later { cell : LazyCell :: new ( ) , f : Box :: new ( move | | f ( ( self . f ) ( ) ) ) , } } }
Caution: If deferred value has been computed, the value
is cloned to create a new Later<T> object!
Caution : If deferred value has been computed the value is cloned to create a new Later<T > object!
self
f
F
self
f
F