eth_uninstallFilter should return false for non-existent filter (#8280)

* eth_uninstallFilter should return false for non-existent filter

* Use shorter form is_some()
This commit is contained in:
Wei Tang 2018-03-31 17:06:16 +08:00 committed by Tomasz Drwięga
parent 443115f885
commit 1e6d889fc7
2 changed files with 3 additions and 4 deletions

View File

@ -74,8 +74,8 @@ impl<F, T> PollManager<F, T> where T: Timer {
} }
/// Removes poll info. /// Removes poll info.
pub fn remove_poll(&mut self, id: &PollId) { pub fn remove_poll(&mut self, id: &PollId) -> bool {
self.polls.remove(id); self.polls.remove(id).is_some()
} }
} }

View File

@ -242,7 +242,6 @@ impl<T: Filterable + Send + Sync + 'static> EthFilter for T {
} }
fn uninstall_filter(&self, index: Index) -> Result<bool> { fn uninstall_filter(&self, index: Index) -> Result<bool> {
self.polls().lock().remove_poll(&index.value()); Ok(self.polls().lock().remove_poll(&index.value()))
Ok(true)
} }
} }