Fixed incorrect function name and Docstring

- Changed `decrement_visiotr` to `decrement_visitor` for clean function name usage.
- Updated a few docstrings.
This commit is contained in:
Dat Adithya 2021-03-11 11:26:15 +05:30 committed by GitHub
parent 8c4f885a85
commit 906cb833a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -90,7 +90,7 @@ pub struct MCaptcha {
}
impl MCaptcha {
/// incerment visiotr count by one
/// increments the visitor count by one
pub fn add_visitor(&mut self) {
self.visitor_threshold += 1;
if self.visitor_threshold > self.defense.visitor_threshold() {
@ -100,8 +100,8 @@ impl MCaptcha {
}
}
/// deccerment visiotr count by one
pub fn decrement_visiotr(&mut self) {
/// decrements the visitor count by one
pub fn decrement_visitor(&mut self) {
if self.visitor_threshold > 0 {
self.visitor_threshold -= 1;
}
@ -129,7 +129,7 @@ struct DeleteVisitor;
impl Handler<DeleteVisitor> for MCaptcha {
type Result = ();
fn handle(&mut self, _msg: DeleteVisitor, _ctx: &mut Self::Context) -> Self::Result {
self.decrement_visiotr();
self.decrement_visitor();
}
}