Add remove_open_ticket function
This commit is contained in:
parent
81686a07ad
commit
6ac3c46b37
1 changed files with 3 additions and 0 deletions
|
|
@ -167,6 +167,9 @@ impl Db {
|
|||
let mut state = self.state.lock().unwrap();
|
||||
if let Some(tickets) = state.open_tickets.get_mut(&road) {
|
||||
tickets.retain(|t| t.plate != ticket.plate);
|
||||
if tickets.is_empty() {
|
||||
state.open_tickets.remove(&road);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
false
|
||||
|
|
|
|||
Loading…
Reference in a new issue