Fix command generating iter
Update the `add_set_address` method in `CommandGeneratingIter` to only
add an address to the set_addresses vector if it isn't already in the
vector.
This eliminates the possibility of an address being deleted twice and
returning an error the second time because it has already been deleted.
@@ -39,8 +39,10 @@ impl CommandGeneratingIter {
}
pub fn add_set_address(&mut self, address: String) {
+ if !self.set_addresses.contains(&address) {
self.set_addresses.push(address);
}
+ }
pub fn remove_set_address(&mut self, index: usize) {
self.set_addresses.remove(index);
