Fix typos (#42)
Found via `codespell -L crate,inout,ser,fetchs,te,tre,whats`.
This commit is contained in:
parent
28f66f4127
commit
40157f6170
10 changed files with 24 additions and 24 deletions
|
@ -25,7 +25,7 @@ pub struct Context<'a> {
|
|||
parent: Option<&'a Context<'a>>,
|
||||
// An optional deadline.
|
||||
deadline: Option<Instant>,
|
||||
// Wether or not this context is cancelled.
|
||||
// Whether or not this context is cancelled.
|
||||
cancelled: Arc<AtomicBool>,
|
||||
// A collection of read only values stored in this context.
|
||||
values: Option<HashMap<String, Cow<'a, Value>>>,
|
||||
|
@ -58,7 +58,7 @@ impl<'a> Context<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
// Add cancelation to the context. The value that is returned will cancel
|
||||
// Add cancellation to the context. The value that is returned will cancel
|
||||
// the context and it's children once called.
|
||||
pub fn add_cancel(&mut self) -> Canceller {
|
||||
let cancelled = self.cancelled.clone();
|
||||
|
|
|
@ -10,7 +10,7 @@ impl From<js::Error> for Error {
|
|||
line,
|
||||
} => Error::InvalidScript {
|
||||
message: format!(
|
||||
"An exception occured{}: {}{}",
|
||||
"An exception occurred{}: {}{}",
|
||||
match file.is_empty() {
|
||||
false => format!(" at {}:{}", file, line),
|
||||
true => String::default(),
|
||||
|
@ -26,7 +26,7 @@ impl From<js::Error> for Error {
|
|||
),
|
||||
},
|
||||
js::Error::Unknown => Error::InvalidScript {
|
||||
message: "An unknown error occured".to_string(),
|
||||
message: "An unknown error occurred".to_string(),
|
||||
},
|
||||
_ => Error::InvalidScript {
|
||||
message: e.to_string(),
|
||||
|
|
|
@ -286,7 +286,7 @@ impl Datastore {
|
|||
let mut txn = self.transaction(false, false).await?;
|
||||
// Process the export
|
||||
txn.export(&ns, &db, chn).await?;
|
||||
// Everythign ok
|
||||
// Everything ok
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1286,7 +1286,7 @@ impl Transaction {
|
|||
chn.send(bytes!("")).await?;
|
||||
}
|
||||
}
|
||||
// Output INDEXS
|
||||
// Output INDEXES
|
||||
let ixs = self.all_ix(ns, db, &tb.name).await?;
|
||||
if !ixs.is_empty() {
|
||||
for ix in ixs.iter() {
|
||||
|
|
|
@ -47,7 +47,7 @@ impl Param {
|
|||
Some(v) => {
|
||||
// Get the path parts
|
||||
let pth: &[Part] = self;
|
||||
// Process the paramater value
|
||||
// Process the parameter value
|
||||
let res = v.compute(ctx, opt, txn, doc).await?;
|
||||
// Return the desired field
|
||||
res.get(ctx, opt, txn, pth.next()).await
|
||||
|
@ -60,7 +60,7 @@ impl Param {
|
|||
Some(v) => {
|
||||
// Get the path parts
|
||||
let pth: &[Part] = self;
|
||||
// Process the paramater value
|
||||
// Process the parameter value
|
||||
let res = v.compute(ctx, opt, txn, doc).await?;
|
||||
// Return the desired field
|
||||
res.get(ctx, opt, txn, pth.next()).await
|
||||
|
|
|
@ -166,7 +166,7 @@ impl InfoStatement {
|
|||
tmp.insert(v.name.to_string(), v.to_string().into());
|
||||
}
|
||||
res.insert("fd".to_owned(), tmp.into());
|
||||
// Process the indexs
|
||||
// Process the indexes
|
||||
let mut tmp = Object::default();
|
||||
for v in run.all_ix(opt.ns(), opt.db(), tb).await?.iter() {
|
||||
tmp.insert(v.name.to_string(), v.to_string().into());
|
||||
|
|
|
@ -53,7 +53,7 @@ fn path_valid(v: &str) -> Result<(), String> {
|
|||
}
|
||||
Err(String::from(
|
||||
"\
|
||||
Provide a valid database path paramater\
|
||||
Provide a valid database path parameter\
|
||||
",
|
||||
))
|
||||
}
|
||||
|
|
|
@ -11,11 +11,11 @@ use surrealdb::sql::Object;
|
|||
use surrealdb::Session;
|
||||
|
||||
pub async fn signin(vars: Object) -> Result<String, Error> {
|
||||
// Parse the speficied variables
|
||||
// Parse the specified variables
|
||||
let ns = vars.get("NS").or_else(|| vars.get("ns"));
|
||||
let db = vars.get("DB").or_else(|| vars.get("db"));
|
||||
let sc = vars.get("SC").or_else(|| vars.get("sc"));
|
||||
// Check if the paramaters exist
|
||||
// Check if the parameters exist
|
||||
match (ns, db, sc) {
|
||||
(Some(ns), Some(db), Some(sc)) => {
|
||||
// Process the provided values
|
||||
|
|
|
@ -9,11 +9,11 @@ use surrealdb::sql::Object;
|
|||
use surrealdb::Session;
|
||||
|
||||
pub async fn signup(vars: Object) -> Result<String, Error> {
|
||||
// Parse the speficied variables
|
||||
// Parse the specified variables
|
||||
let ns = vars.get("NS").or_else(|| vars.get("ns"));
|
||||
let db = vars.get("DB").or_else(|| vars.get("db"));
|
||||
let sc = vars.get("SC").or_else(|| vars.get("sc"));
|
||||
// Check if the paramaters exist
|
||||
// Check if the parameters exist
|
||||
match (ns, db, sc) {
|
||||
(Some(ns), Some(db), Some(sc)) => {
|
||||
// Process the provided values
|
||||
|
|
|
@ -275,7 +275,7 @@ impl Rpc {
|
|||
let opt = CF.get().unwrap();
|
||||
// Specify the SQL query string
|
||||
let sql = "KILL $id";
|
||||
// Specify the query paramaters
|
||||
// Specify the query parameters
|
||||
let var = Some(map! {
|
||||
String::from("id") => id,
|
||||
=> &self.vars
|
||||
|
@ -295,7 +295,7 @@ impl Rpc {
|
|||
let opt = CF.get().unwrap();
|
||||
// Specify the SQL query string
|
||||
let sql = "LIVE SELECT * FROM $tb";
|
||||
// Specify the query paramaters
|
||||
// Specify the query parameters
|
||||
let var = Some(map! {
|
||||
String::from("tb") => tb.make_table(),
|
||||
=> &self.vars
|
||||
|
@ -317,7 +317,7 @@ impl Rpc {
|
|||
let kvs = DB.get().unwrap();
|
||||
// Get local copy of options
|
||||
let opt = CF.get().unwrap();
|
||||
// Specify the query paramaters
|
||||
// Specify the query parameters
|
||||
let var = Some(self.vars.clone());
|
||||
// Execute the query on the database
|
||||
let res = kvs.execute(&sql, &self.session, var, opt.strict).await?;
|
||||
|
@ -332,7 +332,7 @@ impl Rpc {
|
|||
let kvs = DB.get().unwrap();
|
||||
// Get local copy of options
|
||||
let opt = CF.get().unwrap();
|
||||
// Specify the query paramaters
|
||||
// Specify the query parameters
|
||||
let var = Some(mrg! { vars.0, &self.vars });
|
||||
// Execute the query on the database
|
||||
let res = kvs.execute(&sql, &self.session, var, opt.strict).await?;
|
||||
|
@ -353,7 +353,7 @@ impl Rpc {
|
|||
let opt = CF.get().unwrap();
|
||||
// Specify the SQL query string
|
||||
let sql = "SELECT * FROM $what";
|
||||
// Specify the query paramaters
|
||||
// Specify the query parameters
|
||||
let var = Some(map! {
|
||||
String::from("what") => what.make_table_or_thing(),
|
||||
=> &self.vars
|
||||
|
@ -377,7 +377,7 @@ impl Rpc {
|
|||
let opt = CF.get().unwrap();
|
||||
// Specify the SQL query string
|
||||
let sql = "CREATE $what CONTENT $data RETURN AFTER";
|
||||
// Specify the query paramaters
|
||||
// Specify the query parameters
|
||||
let var = Some(map! {
|
||||
String::from("what") => what.make_table_or_thing(),
|
||||
String::from("data") => data.into().into(),
|
||||
|
@ -402,7 +402,7 @@ impl Rpc {
|
|||
let opt = CF.get().unwrap();
|
||||
// Specify the SQL query string
|
||||
let sql = "UPDATE $what CONTENT $data RETURN AFTER";
|
||||
// Specify the query paramaters
|
||||
// Specify the query parameters
|
||||
let var = Some(map! {
|
||||
String::from("what") => what.make_table_or_thing(),
|
||||
String::from("data") => data.into().into(),
|
||||
|
@ -427,7 +427,7 @@ impl Rpc {
|
|||
let opt = CF.get().unwrap();
|
||||
// Specify the SQL query string
|
||||
let sql = "UPDATE $what MERGE $data RETURN AFTER";
|
||||
// Specify the query paramaters
|
||||
// Specify the query parameters
|
||||
let var = Some(map! {
|
||||
String::from("what") => what.make_table_or_thing(),
|
||||
String::from("data") => data.into().into(),
|
||||
|
@ -452,7 +452,7 @@ impl Rpc {
|
|||
let opt = CF.get().unwrap();
|
||||
// Specify the SQL query string
|
||||
let sql = "UPDATE $what PATCH $data RETURN DIFF";
|
||||
// Specify the query paramaters
|
||||
// Specify the query parameters
|
||||
let var = Some(map! {
|
||||
String::from("what") => what.make_table_or_thing(),
|
||||
String::from("data") => data.into().into(),
|
||||
|
@ -477,7 +477,7 @@ impl Rpc {
|
|||
let opt = CF.get().unwrap();
|
||||
// Specify the SQL query string
|
||||
let sql = "DELETE $what";
|
||||
// Specify the query paramaters
|
||||
// Specify the query parameters
|
||||
let var = Some(map! {
|
||||
String::from("what") => what.make_table_or_thing(),
|
||||
=> &self.vars
|
||||
|
|
Loading…
Reference in a new issue