Fix typos

This commit is contained in:
Kian-Meng Ang
2022-08-04 23:06:54 +08:00
parent 961bb6c5f4
commit bb42841a66
19 changed files with 43 additions and 43 deletions

View File

@@ -26,7 +26,7 @@
//!
//! ## Organisation
//!
//! Database functionallity is divided accross various modules:
//! Database functionality is divided across various modules:
//!
//! - [errors](crate::auth): error data structures used in this crate
//! - [ops](crate::ops): meta operations like connection pool creation, migrations and getting
@@ -242,13 +242,13 @@ pub trait MCDatabase: std::marker::Send + std::marker::Sync + CloneSPDatabase {
/// record PoWConfig confirms
async fn record_confirm(&self, key: &str) -> DBResult<()>;
/// featch PoWConfig fetches
/// fetch PoWConfig fetches
async fn fetch_config_fetched(&self, user: &str, key: &str) -> DBResult<Vec<i64>>;
/// featch PoWConfig solves
/// fetch PoWConfig solves
async fn fetch_solve(&self, user: &str, key: &str) -> DBResult<Vec<i64>>;
/// featch PoWConfig confirms
/// fetch PoWConfig confirms
async fn fetch_confirm(&self, user: &str, key: &str) -> DBResult<Vec<i64>>;
}
@@ -287,7 +287,7 @@ pub struct AddNotification<'a> {
pub from: &'a str,
/// heading of the notification
pub heading: &'a str,
/// mesage of the notification
/// message of the notification
pub message: &'a str,
}
@@ -298,12 +298,12 @@ pub struct TrafficPattern {
pub avg_traffic: u32,
/// the peak traffic that the user's website can handle
pub peak_sustainable_traffic: u32,
/// trafic that bought the user's website down; optional
/// traffic that bought the user's website down; optional
pub broke_my_site_traffic: Option<u32>,
}
#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
/// data requried to create new captcha
/// data required to create new captcha
pub struct CreateCaptcha<'a> {
/// cool down duration
pub duration: i32,

View File

@@ -30,7 +30,7 @@ pub trait GetConnection {
async fn get_conn(&self) -> DBResult<Self::Conn>;
}
/// Create databse connection
/// Create database connection
#[async_trait]
pub trait Connect {
/// database specific pool-type

View File

@@ -33,7 +33,7 @@ pub async fn database_works<'a, T: MCDatabase>(
db.delete_user(p.username).await.unwrap();
assert!(
!db.username_exists(p.username).await.unwrap(),
"user is deleted so username shouldn't exsit"
"user is deleted so username shouldn't exist"
);
}
@@ -89,11 +89,11 @@ pub async fn database_works<'a, T: MCDatabase>(
// testing email exists
assert!(
db.email_exists(p.email.as_ref().unwrap()).await.unwrap(),
"user is registered so email should exsit"
"user is registered so email should exist"
);
assert!(
db.username_exists(p.username).await.unwrap(),
"user is registered so username should exsit"
"user is registered so username should exist"
);
// update password test. setting password = username
@@ -124,7 +124,7 @@ pub async fn database_works<'a, T: MCDatabase>(
db.delete_user(p.email.as_ref().unwrap()).await.unwrap();
assert!(
!db.username_exists(p.email.as_ref().unwrap()).await.unwrap(),
"user is deleted so username shouldn't exsit"
"user is deleted so username shouldn't exist"
);
// register with email = None
@@ -133,11 +133,11 @@ pub async fn database_works<'a, T: MCDatabase>(
db.register(&p2).await.unwrap();
assert!(
db.username_exists(p2.username).await.unwrap(),
"user is registered so username should exsit"
"user is registered so username should exist"
);
assert!(
!db.email_exists(p.email.as_ref().unwrap()).await.unwrap(),
"user registration with email is deleted; so email shouldn't exsit"
"user registration with email is deleted; so email shouldn't exist"
);
// testing get_email = None
@@ -155,7 +155,7 @@ pub async fn database_works<'a, T: MCDatabase>(
);
assert!(
db.email_exists(p.email.as_ref().unwrap()).await.unwrap(),
"user was with empty email but email is set; so email should exsit"
"user was with empty email but email is set; so email should exist"
);
/*