fn unary_fn_in_place<U: FnOnce(&mut Self::Elem)>(
        &mut self,
        unary_fn: U,
    ) -> Result<(), crate::StackError> {
        match self.container.last_mut() {
            Some(first_elem_mut_ref) => {
                unary_fn(first_elem_mut_ref);
                Ok(())
            }
            None => Err(crate::StackError::NotEnoughOperands {
                num_required: 1,
                num_available: 0,
            }),
        }
    }
/// Appy a unary operation to the lowest register in-place.
///
/// # Example
///
/// ```
/// use smsflib::prelude::*;
///
/// let mut stack = DynamicSizedStack::<u32>::new();
/// let res = stack.unary_fn_in_place(|x: &mut u32| {*x += 10; } );
///
/// assert_eq!(res, Err(smsflib::StackError::NotEnoughOperands { num_required: 1, num_available: 0 }));
/// ```
///
/// ```
/// use smsflib::prelude::*;
///
/// let mut stack = DynamicSizedStack::<u32>::clone_from_slice(&[3, 2, 1]);
/// let res = stack.unary_fn_in_place(|x: &mut u32| {*x += 10; } );
///
/// assert_eq!(res, Ok(()));
///
/// assert_eq!(stack.len(), 3);
/// assert_eq!(stack.get(0), Some(&11));
/// assert_eq!(stack.get(1), Some(&2));
/// assert_eq!(stack.get(2), Some(&3));
/// ```
///
Appy a unary operation to the lowest register in-place.
Appy a unary operation to the lowest register in - place .
fn unary_fn_in_place<U: FnOnce(&mut Self::Elem)>(
        &mut self,
        unary_fn: U,
    ) -> Result<(), crate::StackError> {
        match self.container.last_mut() {
            Some(first_elem_mut_ref) => {
                unary_fn(first_elem_mut_ref);
                Ok(())
            }
            None => Err(crate::StackError::NotEnoughOperands {
                num_required: 1,
                num_available: 0,
            }),
        }
    }
fn unary_fn_in_place < U : FnOnce ( & mut Self :: Elem ) > ( & mut self , unary_fn : U , ) -> Result < ( ) , crate :: StackError > { match self . container . last_mut ( ) { Some ( first_elem_mut_ref ) => { unary_fn ( first_elem_mut_ref ) ; Ok ( ( ) ) } None => Err ( crate :: StackError :: NotEnoughOperands { num_required : 1 , num_available : 0 , } ) , } }
Appy a unary operation to the lowest register in-place.
Appy a unary operation to the lowest register in - place .
&mut self
unary_fn
U
example
```
use smsflib::prelude::*.

let mut stack = DynamicSizedStack::::new();
let res = stack.unary_fn_in_place(|x: &mut u32| {*x += 10; } ).

assert_eq!(res, Err(smsflib::StackError::NotEnoughOperands { num_required: 1, num_available: 0 }));
```

```
use smsflib::prelude::*.






` ` ` use smsflib :: prelude :: * . let mut stack = DynamicSizedStack :::: new () ; let res = stack . unary_fn_in_place ( |x : &mut u32| { * x + = 10 ; } ) . assert_eq! ( res Err ( smsflib :: StackError :: NotEnoughOperands { num_required : 1 num_available : 0 } )) ; ` ` ` ` ` ` use smsflib :: prelude :: * .