rm MCaptcha::decrement_visitor

This commit is contained in:
Aravinth Manivannan 2021-08-31 19:21:48 +05:30
parent b2684d9348
commit 48220d78e7
Signed by: realaravinth
GPG key ID: AD9F0F08E855ED88
3 changed files with 5 additions and 9 deletions

View file

@ -25,6 +25,10 @@
- `System::get_pow` returns `errors::CaptchaResult<Option<PoWConfig>>`
instead of `Option<PoWConfig>`
## Removed
- `MCaptcha::decrement_visiotr`: seemed redundant when
`MCaptcha::decrement_visitor_by` was available
## 0.1.3
## Added

View file

@ -111,7 +111,7 @@ struct DeleteVisitor;
impl Handler<DeleteVisitor> for Counter {
type Result = ();
fn handle(&mut self, _msg: DeleteVisitor, _ctx: &mut Self::Context) -> Self::Result {
self.0.decrement_visitor();
self.0.decrement_visitor_by(1);
}
}

View file

@ -99,14 +99,6 @@ impl MCaptcha {
}
}
/// decrements the visitor count by one
#[inline]
pub fn decrement_visitor(&mut self) {
if self.visitor_threshold > 0 {
self.visitor_threshold -= 1;
}
}
/// decrements the visitor count by specified count
#[inline]
pub fn decrement_visitor_by(&mut self, count: u32) {