Skip to content

Commit

Permalink
Add add_mut to filters and updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Jurshsmith committed Apr 17, 2024
1 parent ae070e2 commit 8bcb9b7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion chaindexing/src/states/filters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@ impl Filters {
}
}
pub fn add(mut self, field: impl ToString, value: impl ToString) -> Self {
self.values.insert(field.to_string(), value.to_string());
self.add_mut(field.to_string(), value.to_string());
self
}
pub fn add_mut(&mut self, field: impl ToString, value: impl ToString) {
self.values.insert(field.to_string(), value.to_string());
}
pub fn within_contract(mut self) -> Self {
self.context = FiltersContext::Contract;
self
Expand Down
5 changes: 4 additions & 1 deletion chaindexing/src/states/updates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ impl Updates {
}
}
pub fn add(mut self, field: impl ToString, value: impl ToString) -> Self {
self.values.insert(field.to_string(), value.to_string());
self.add_mut(field.to_string(), value.to_string());
self
}
pub fn add_mut(&mut self, field: impl ToString, value: impl ToString) {
self.values.insert(field.to_string(), value.to_string());
}
}

0 comments on commit 8bcb9b7

Please sign in to comment.