fn take_f(me: Pin<&mut Option<Inner<Fut, F>>>) -> Option<F> {
        unsafe {
            let opt = me.get_unchecked_mut();
            let opt_ptr : *mut Option<Inner<Fut, F>> = opt;
            match opt {
                None => None,
                Some(Inner { future, f }) => {
                    // clean up invalid state if future::drop() panics
                    let auto_take = UnsafeSetNoneOnDrop(opt_ptr);
                    ptr::drop_in_place(future);
                    let rv = ptr::read(f);
                    mem::drop(auto_take);
                    Some(rv)
                }
            }
        }
    }
/// Extracts the map function while dropping the future without violating
/// the Pin guarantee like a simple Option::take would
Extracts the map function while dropping the future without violating
the Pin guarantee like a simple Option::take would
Extracts the map function while dropping the future without violating the Pin guarantee like a simple Option :: take would
fn take_f(me: Pin<&mut Option<Inner<Fut, F>>>) -> Option<F> {
        unsafe {
            let opt = me.get_unchecked_mut();
            let opt_ptr : *mut Option<Inner<Fut, F>> = opt;
            match opt {
                None => None,
                Some(Inner { future, f }) => {
                    // clean up invalid state if future::drop() panics
                    let auto_take = UnsafeSetNoneOnDrop(opt_ptr);
                    ptr::drop_in_place(future);
                    let rv = ptr::read(f);
                    mem::drop(auto_take);
                    Some(rv)
                }
            }
        }
    }
fn take_f ( me : Pin < & mut Option < Inner < Fut , F > > > ) -> Option < F > { unsafe { let opt = me . get_unchecked_mut ( ) ; let opt_ptr : * mut Option < Inner < Fut , F > > = opt ; match opt { None => None , Some ( Inner { future , f } ) => { // clean up invalid state if future::drop() panics let auto_take = UnsafeSetNoneOnDrop ( opt_ptr ) ; ptr :: drop_in_place ( future ) ; let rv = ptr :: read ( f ) ; mem :: drop ( auto_take ) ; Some ( rv ) } } } }
Extracts the map function while dropping the future without violating
the Pin guarantee like a simple Option::take would
Extracts the map function while dropping the future without violating the Pin guarantee like a simple Option :: take would
me
Pin<&mut Option<Inner<Fut, F>>>
me
Pin<&mut Option<Inner<Fut, F>>>