rm MCaptcha::decrement_visitor
This commit is contained in:
parent
b2684d9348
commit
48220d78e7
3 changed files with 5 additions and 9 deletions
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue