/// Remove an item from the group, based on its index.
///
/// As the budget items do not contain a notion of identity, the removal has to be done based
/// on the item's position in the group.
///
/// # Parameters
/// * `idx` - the index of the item to be removed, as discovered using [`enumerate`](#method.enumerate).
///
/// # Returns
/// `Result::Ok()` if the index is valid and an item was therefore removed, or `Result::Err` if
/// the index is invalid.
Remove an item from the group, based on its index.
As the budget items do not contain a notion of identity, the removal has to be done based
on the item's position in the group.
Remove an item from the group based on its index . As the budget items do not contain a notion of identity the removal has to be done based on the item ' s position in the group .
pub fn remove(&mut self, idx: usize) -> Result<(), ()> {
        if idx > self.items.len() {
            return Err(());
        }
        self.items.remove(idx);
        self.items.sort_unstable();
        Ok(())
    }
pub fn remove ( & mut self , idx : usize ) -> Result < ( ) , ( ) > { if idx > self . items . len ( ) { return Err ( ( ) ) ; } self . items . remove ( idx ) ; self . items . sort_unstable ( ) ; Ok ( ( ) ) }
Remove an item from the group, based on its index.
Remove an item from the group based on its index .
`Result::Ok()` if the index is valid and an item was therefore removed, or `Result::Err` if
the index is invalid.
` Result :: Ok () ` if the index is valid and an item was therefore removed or ` Result :: Err ` if the index is invalid .
&mut self
idx
usize