pub fn remove(&mut self, id: i32) -> DataResult<Vec<ToDo>> {
        println!("Attempting to remove todo with id {}", id);
        if id < 0 {
            return Err(DataError::new("ID is required to remove an item"))
        }
        self.todos.retain(|t| t.id != id);
        self.save_and_get()
    }
/// Remove any ToDos with the matching id
Remove any ToDos with the matching id
Remove any ToDos with the matching id
pub fn remove(&mut self, id: i32) -> DataResult<Vec<ToDo>> {
        println!("Attempting to remove todo with id {}", id);
        if id < 0 {
            return Err(DataError::new("ID is required to remove an item"))
        }
        self.todos.retain(|t| t.id != id);
        self.save_and_get()
    }
pub fn remove ( & mut self , id : i32 ) -> DataResult < Vec < ToDo > > { println ! ( " " id ) ; if id < 0 { return Err ( DataError :: new ( " " ) ) } self . todos . retain ( | t | t . id != id ) ; self . save_and_get ( ) }
Remove any ToDos with the matching id
Remove any ToDos with the matching id
&mut self
id
i32
&mut self
id
i32