pub fn pop(&mut self) -> Result<T, PopError> {
        match unsafe { self.pop_access(|slice, _| {
            let elem = mem::replace(&mut slice[0], mem::uninitialized());
            Ok((1, elem))
        }) } {
            Ok(res) => match res {
                Ok((n, elem)) => {
                    debug_assert_eq!(n, 1);
                    Ok(elem)
                },
                Err(()) => unreachable!(),
            },
            Err(e) => match e {
                PopAccessError::Empty => Err(PopError::Empty),
                PopAccessError::BadLen => unreachable!(),
            }
        }
    }
/// Removes first element from the ring buffer and returns it.
Removes first element from the ring buffer and returns it.
Removes first element from the ring buffer and returns it .
pub fn pop(&mut self) -> Result<T, PopError> {
        match unsafe { self.pop_access(|slice, _| {
            let elem = mem::replace(&mut slice[0], mem::uninitialized());
            Ok((1, elem))
        }) } {
            Ok(res) => match res {
                Ok((n, elem)) => {
                    debug_assert_eq!(n, 1);
                    Ok(elem)
                },
                Err(()) => unreachable!(),
            },
            Err(e) => match e {
                PopAccessError::Empty => Err(PopError::Empty),
                PopAccessError::BadLen => unreachable!(),
            }
        }
    }
pub fn pop ( & mut self ) -> Result < T , PopError > { match unsafe { self . pop_access ( | slice , _ | { let elem = mem :: replace ( & mut slice [ 0 ] , mem :: uninitialized ( ) ) ; Ok ( ( 1 , elem ) ) } ) } { Ok ( res ) => match res { Ok ( ( n , elem ) ) => { debug_assert_eq ! ( n 1 ) ; Ok ( elem ) } , Err ( ( ) ) => unreachable ! ( ) , } , Err ( e ) => match e { PopAccessError :: Empty => Err ( PopError :: Empty ) , PopAccessError :: BadLen => unreachable ! ( ) , } } }
Removes first element from the ring buffer and returns it.
Removes first element from the ring buffer and returns it .
&mut self
&mut self