From 74ad6937095e1cab33648c47a3147c49ce6393a2 Mon Sep 17 00:00:00 2001 From: Jan S Date: Thu, 28 Sep 2023 11:17:29 +0200 Subject: [PATCH] Fix typos (#2764) --- doc/BUILDING.md | 4 +-- lib/fuzz/README.md | 4 +-- lib/src/api/conn.rs | 6 ++-- lib/src/api/mod.rs | 2 +- lib/src/cf/writer.rs | 2 +- lib/src/dbs/executor.rs | 2 +- lib/src/dbs/options.rs | 2 +- lib/src/dbs/session.rs | 2 +- lib/src/fnc/script/fetch/body.rs | 2 +- lib/src/fnc/script/fetch/classes/request.rs | 2 +- lib/src/fnc/script/fetch/stream.rs | 2 +- lib/src/fnc/script/fetch/util.rs | 6 ++-- lib/src/fnc/script/main.rs | 2 +- lib/src/iam/verify.rs | 6 ++-- lib/src/key/root/hb.rs | 2 +- lib/src/kvs/tx.rs | 2 +- lib/src/sql/array.rs | 2 +- lib/src/sql/builtin.rs | 2 +- lib/src/sql/duration.rs | 2 +- lib/src/sql/error/render.rs | 10 +++---- lib/src/sql/error/utils.rs | 2 +- lib/src/sql/geometry.rs | 2 +- lib/src/sql/limit.rs | 2 +- lib/src/sql/start.rs | 2 +- lib/src/sql/statements/option.rs | 2 +- lib/src/sql/statements/select.rs | 2 +- lib/src/sql/util.rs | 22 +++++++------- lib/src/sql/value/value.rs | 32 ++++++++++----------- lib/tests/api.rs | 2 +- lib/tests/complex.rs | 2 +- lib/tests/future.rs | 2 +- src/net/client_ip.rs | 6 ++-- 32 files changed, 71 insertions(+), 71 deletions(-) diff --git a/doc/BUILDING.md b/doc/BUILDING.md index dca49497..b5c5dac4 100644 --- a/doc/BUILDING.md +++ b/doc/BUILDING.md @@ -331,7 +331,7 @@ docker run --pull --rm -v $PWD:/volume -t clux/muslrust:stable cargo build --rel ### ✅ Compile for `windows-amd64` -> Compiling SurrealDB with windows OS requires **Administrator** priveledge! +> Compiling SurrealDB with windows OS requires **Administrator** privilege! ⚠**Tested on Windows 11 build 22H2(22621.963)** @@ -354,7 +354,7 @@ docker run --pull --rm -v $PWD:/volume -t clux/muslrust:stable cargo build --rel e.g. "C:\patch" - > For some bizzare reasons, **patch.exe needs elevated priviledge** to be invoked during compilation + > For some bizzarre reasons, **patch.exe needs elevated privileges** to be invoked during compilation 5. Add `gcc` and `patch` binary path to environment diff --git a/lib/fuzz/README.md b/lib/fuzz/README.md index f0cdc372..f0fd4f06 100644 --- a/lib/fuzz/README.md +++ b/lib/fuzz/README.md @@ -17,7 +17,7 @@ available in the nightly release. Unfortunately for us the nightly release is a little unstable and there was a [bug](https://github.com/rust-lang/rust/issues/110475) in the latest version of the nightly compiler that prevents use from compiling -some of surrealdb's depdendencies. To workaround this issue we've carefully +some of surrealdb's dependencies. To workaround this issue we've carefully picked a version of the nightly compiler that works with both cargo-fuzz and our dependencies. This version is `nightly-2023-04-21`. To install this version we simply need to run; @@ -58,7 +58,7 @@ The previous command will run the fuzzer in libfuzzer's default mode, which means as a single thread. If you would like to speed fuzzing up we can make use of all cores, and use a dictionary file. e.g. ``` -# -fork: Run N seperate process fuzzing in parralell in this case we +# -fork: Run N separate process fuzzing in parallel in this case we # use nproc to match the number of processors on our local # machine. # -dict: Make use the fuzzer specific dictionary file. diff --git a/lib/src/api/conn.rs b/lib/src/api/conn.rs index f7004d55..39e67ffa 100644 --- a/lib/src/api/conn.rs +++ b/lib/src/api/conn.rs @@ -61,7 +61,7 @@ where pub enum Method { /// Sends an authentication token to the server Authenticate, - /// Perfoms a merge update operation + /// Performs a merge update operation Merge, /// Creates a record in a table Create, @@ -81,7 +81,7 @@ pub enum Method { /// Starts a live query #[doc(hidden)] // Not supported yet Live, - /// Perfoms a patch update operation + /// Performs a patch update operation Patch, /// Sends a raw query to the database Query, @@ -95,7 +95,7 @@ pub enum Method { Signup, /// Removes a parameter from a connection Unset, - /// Perfoms an update operation + /// Performs an update operation Update, /// Selects a namespace and database to use Use, diff --git a/lib/src/api/mod.rs b/lib/src/api/mod.rs index 1b589654..c13012ab 100644 --- a/lib/src/api/mod.rs +++ b/lib/src/api/mod.rs @@ -103,7 +103,7 @@ where fn into_future(self) -> Self::IntoFuture { Box::pin(async move { - // Avoid establising another connection if already connected + // Avoid establishing another connection if already connected if self.router.get().is_some() { return Err(Error::AlreadyConnected.into()); } diff --git a/lib/src/cf/writer.rs b/lib/src/cf/writer.rs index a7a163e2..0d7f8924 100644 --- a/lib/src/cf/writer.rs +++ b/lib/src/cf/writer.rs @@ -204,7 +204,7 @@ mod tests { tx3.commit().await.unwrap(); // Note that we committed tx1, tx2, and tx3 in this order so far. - // Therfore, the change feeds should give us + // Therefore, the change feeds should give us // the mutations in the commit order, which is tx1, tx3, then tx2. let start: u64 = 0; diff --git a/lib/src/dbs/executor.rs b/lib/src/dbs/executor.rs index a162d592..42011a97 100644 --- a/lib/src/dbs/executor.rs +++ b/lib/src/dbs/executor.rs @@ -65,7 +65,7 @@ impl<'a> Executor<'a> { /// /// # Return /// - /// An `Err` if the transaction could not be commited; + /// An `Err` if the transaction could not be committed; /// otherwise returns `Ok`. async fn commit(&mut self, local: bool) -> Result<(), Error> { if local { diff --git a/lib/src/dbs/options.rs b/lib/src/dbs/options.rs index ab8c7733..de9de6ba 100644 --- a/lib/src/dbs/options.rs +++ b/lib/src/dbs/options.rs @@ -516,7 +516,7 @@ impl Options { } }; - // Check permissions if the autor is not already allowed to do the action + // Check permissions if the author is not already allowed to do the action !is_allowed } } diff --git a/lib/src/dbs/session.rs b/lib/src/dbs/session.rs index 54e082e0..817b3221 100644 --- a/lib/src/dbs/session.rs +++ b/lib/src/dbs/session.rs @@ -145,7 +145,7 @@ impl Session { Session::for_level(Level::Root, Role::Editor) } - /// Create a system session for the root level with Viwer role + /// Create a system session for the root level with Viewer role pub fn viewer() -> Session { Session::for_level(Level::Root, Role::Viewer) } diff --git a/lib/src/fnc/script/fetch/body.rs b/lib/src/fnc/script/fetch/body.rs index 17cb19b7..b15edd6b 100644 --- a/lib/src/fnc/script/fetch/body.rs +++ b/lib/src/fnc/script/fetch/body.rs @@ -50,7 +50,7 @@ impl Body { } } - /// Returns wther the body is alread used. + /// Returns whether the body is already used. pub fn used(&self) -> bool { match self.data.replace(BodyData::Used) { BodyData::Used => true, diff --git a/lib/src/fnc/script/fetch/classes/request.rs b/lib/src/fnc/script/fetch/classes/request.rs index a90ee692..8b05afb8 100644 --- a/lib/src/fnc/script/fetch/classes/request.rs +++ b/lib/src/fnc/script/fetch/classes/request.rs @@ -419,7 +419,7 @@ impl<'js> Request<'js> { } else { Err(Exception::throw_type( &ctx, - "request `init` paramater must either be a request object or a string", + "request `init` parameter must either be a request object or a string", )) } } diff --git a/lib/src/fnc/script/fetch/stream.rs b/lib/src/fnc/script/fetch/stream.rs index 542d7e9d..dbee5e4e 100644 --- a/lib/src/fnc/script/fetch/stream.rs +++ b/lib/src/fnc/script/fetch/stream.rs @@ -3,7 +3,7 @@ use std::{future::Future, pin::Pin}; use channel::Receiver; use futures::{FutureExt, Stream, StreamExt}; -/// A newtype struct over reciever implementing the [`Stream`] trait. +/// A newtype struct over receiver implementing the [`Stream`] trait. pub struct ChannelStream(Receiver); impl Stream for ChannelStream { diff --git a/lib/src/fnc/script/fetch/util.rs b/lib/src/fnc/script/fetch/util.rs index d872ed69..bb4341d5 100644 --- a/lib/src/fnc/script/fetch/util.rs +++ b/lib/src/fnc/script/fetch/util.rs @@ -1,14 +1,14 @@ -/// Returns wether the status code is an null body status +/// Returns whether the status code is an null body status pub fn is_null_body_status(status: u16) -> bool { matches!(status, 101 | 103 | 204 | 205 | 304) } -/// Returns wether the status code is an ok status +/// Returns whether the status code is an ok status pub fn is_ok_status(status: u16) -> bool { (200..=299).contains(&status) } -/// Returns wether the status code is an redirect status +/// Returns whether the status code is an redirect status pub fn is_redirect_status(status: u16) -> bool { [301, 302, 303, 307, 308].contains(&status) } diff --git a/lib/src/fnc/script/main.rs b/lib/src/fnc/script/main.rs index b3199abe..4641704d 100644 --- a/lib/src/fnc/script/main.rs +++ b/lib/src/fnc/script/main.rs @@ -91,7 +91,7 @@ pub async fn run( // Get the context global object let global = ctx.globals(); - // SAFETY: This is safe because the runtime only lifes for the duration of this + // SAFETY: This is safe because the runtime only lives for the duration of this // function. For the entire duration of which context, opt, txn and doc are valid. unsafe{ create_query_data(context,opt,txn,doc,&ctx) }?; // Register the surrealdb module as a global object diff --git a/lib/src/iam/verify.rs b/lib/src/iam/verify.rs index b6db1ead..5f3ff0b4 100644 --- a/lib/src/iam/verify.rs +++ b/lib/src/iam/verify.rs @@ -561,7 +561,7 @@ mod tests { }; let res = basic(&ds, &mut sess, "user", "invalid").await; - assert!(res.is_err(), "Unexpect successful signin: {:?}", res); + assert!(res.is_err(), "Unexpected successful signin: {:?}", res); } } @@ -632,7 +632,7 @@ mod tests { }; let res = basic(&ds, &mut sess, "user", "invalid").await; - assert!(res.is_err(), "Unexpect successful signin: {:?}", res); + assert!(res.is_err(), "Unexpected successful signin: {:?}", res); } } @@ -705,7 +705,7 @@ mod tests { }; let res = basic(&ds, &mut sess, "user", "invalid").await; - assert!(res.is_err(), "Unexpect successful signin: {:?}", res); + assert!(res.is_err(), "Unexpected successful signin: {:?}", res); } } diff --git a/lib/src/key/root/hb.rs b/lib/src/key/root/hb.rs index 0caa6435..c115013c 100644 --- a/lib/src/key/root/hb.rs +++ b/lib/src/key/root/hb.rs @@ -44,7 +44,7 @@ impl Hb { } pub fn suffix(ts: &Timestamp) -> Vec { - // Add one to timestmap so we get a complete range inclusive of provided timestamp + // Add one to timestamp so we get a complete range inclusive of provided timestamp // Also convert type let tskey: KeyTimestamp = KeyTimestamp { value: ts.value + 1, diff --git a/lib/src/kvs/tx.rs b/lib/src/kvs/tx.rs index 3cf6f248..72e7871a 100644 --- a/lib/src/kvs/tx.rs +++ b/lib/src/kvs/tx.rs @@ -2643,7 +2643,7 @@ impl Transaction { // // Under the hood, this function calls the transaction's `set_versionstamped_key` for each change. // Every change must be recorded by calling this struct's `record_change` function beforehand. - // If there was no preceeding `record_change` function calls for this transaction, this function will do nothing. + // If there were no preceding `record_change` function calls for this transaction, this function will do nothing. // // This function should be called only after all the changes have been made to the transaction. // Otherwise, changes are missed in the change feed. diff --git a/lib/src/sql/array.rs b/lib/src/sql/array.rs index 5284fc9d..483b594b 100644 --- a/lib/src/sql/array.rs +++ b/lib/src/sql/array.rs @@ -360,7 +360,7 @@ impl Intersect for Array { // Documented with the assumption that it is just for arrays. pub(crate) trait Matches { - /// Returns an array complimenting the origional where each value is true or false + /// Returns an array complimenting the original where each value is true or false /// depending on whether it is == to the compared value. /// /// Admittedly, this is most often going to be used in `count(array::matches($arr, $val))` diff --git a/lib/src/sql/builtin.rs b/lib/src/sql/builtin.rs index f976245d..4b2fe937 100644 --- a/lib/src/sql/builtin.rs +++ b/lib/src/sql/builtin.rs @@ -114,7 +114,7 @@ macro_rules! impl_builtins { Err(_) => { return Err(Err::Error(ParseError::Expected{ tried: $input, - expected: "a path seperator `::`" + expected: "a path separator `::`" })) } } diff --git a/lib/src/sql/duration.rs b/lib/src/sql/duration.rs index 22effc33..7f593b92 100644 --- a/lib/src/sql/duration.rs +++ b/lib/src/sql/duration.rs @@ -181,7 +181,7 @@ impl fmt::Display for Duration { // Calculate the total minutes let mins = secs / SECONDS_PER_MINUTE; let secs = secs % SECONDS_PER_MINUTE; - // Calculate the total millseconds + // Calculate the total milliseconds let msec = nano / NANOSECONDS_PER_MILLISECOND; let nano = nano % NANOSECONDS_PER_MILLISECOND; // Calculate the total microseconds diff --git a/lib/src/sql/error/render.rs b/lib/src/sql/error/render.rs index af76cd4b..b37cafbf 100644 --- a/lib/src/sql/error/render.rs +++ b/lib/src/sql/error/render.rs @@ -31,14 +31,14 @@ pub enum Truncation { Both, } -/// A piece of the source code with a location and an optional explenation. +/// A piece of the source code with a location and an optional explanation. #[derive(Clone, Debug)] pub struct Snippet { - /// The part of the orignal source code, + /// The part of the original source code, source: String, - /// Wether part of the source line was truncated. + /// Whether part of the source line was truncated. truncation: Truncation, - /// The location of the snippet in the orignal source code. + /// The location of the snippet in the original source code. location: Location, /// The offset, in chars, into the snippet where the location is. offset: usize, @@ -73,7 +73,7 @@ impl Snippet { fn truncate_line(mut line: &str, around_offset: usize) -> (&str, Truncation, usize) { let full_line_length = line.chars().count(); line = line.trim_start(); - // Saturate in case the error ocurred in invalid leading whitespace. + // Saturate in case the error occurred in invalid leading whitespace. let mut offset = around_offset.saturating_sub(full_line_length - line.chars().count()); line = line.trim_end(); let mut truncation = Truncation::None; diff --git a/lib/src/sql/error/utils.rs b/lib/src/sql/error/utils.rs index 0f4ee12a..66d44444 100644 --- a/lib/src/sql/error/utils.rs +++ b/lib/src/sql/error/utils.rs @@ -57,7 +57,7 @@ where } pub trait ExplainResultExt { - /// A function which adds a explaination to an error if the parser fails at a place which can + /// A function which adds a explanation to an error if the parser fails at a place which can /// be parsed with the given parser. fn explain(self, explain: &'static str, condition: P) -> Self where diff --git a/lib/src/sql/geometry.rs b/lib/src/sql/geometry.rs index d9f7fcec..61ff8fa4 100644 --- a/lib/src/sql/geometry.rs +++ b/lib/src/sql/geometry.rs @@ -794,7 +794,7 @@ fn polygon_vals(i: &str) -> IResult<&str, Polygon> { let (i, mut e) = delimited_list1(openbracket, commas, terminated(line_vals, mightbespace), char(']'))(i)?; let v = e.split_off(1); - // delimited_list1 guarentees there is atleast one value. + // delimited_list1 guarantees there is atleast one value. let e = e.into_iter().next().unwrap(); Ok((i, Polygon::new(e, v))) } diff --git a/lib/src/sql/limit.rs b/lib/src/sql/limit.rs index 241c7d4d..aea269c8 100644 --- a/lib/src/sql/limit.rs +++ b/lib/src/sql/limit.rs @@ -32,7 +32,7 @@ impl Limit { Ok(v) => Err(Error::InvalidLimit { value: v.as_string(), }), - // A different error occured + // A different error occurred Err(e) => Err(e), } } diff --git a/lib/src/sql/start.rs b/lib/src/sql/start.rs index a748f7c5..27255b98 100644 --- a/lib/src/sql/start.rs +++ b/lib/src/sql/start.rs @@ -32,7 +32,7 @@ impl Start { Ok(v) => Err(Error::InvalidStart { value: v.as_string(), }), - // A different error occured + // A different error occurred Err(e) => Err(e), } } diff --git a/lib/src/sql/statements/option.rs b/lib/src/sql/statements/option.rs index 33c3a6d0..13eb5854 100644 --- a/lib/src/sql/statements/option.rs +++ b/lib/src/sql/statements/option.rs @@ -37,7 +37,7 @@ pub fn option(i: &str) -> IResult<&str, OptionStatement> { let (i, _) = shouldbespace(i)?; let (i, n) = ident(i)?; let (i, v) = expected( - "'=' follwed by a value for the option", + "'=' followed by a value for the option", cut(opt(alt(( value(true, tuple((mightbespace, char('='), mightbespace, tag_no_case("TRUE")))), value(false, tuple((mightbespace, char('='), mightbespace, tag_no_case("FALSE")))), diff --git a/lib/src/sql/statements/select.rs b/lib/src/sql/statements/select.rs index 03dfbda9..38dbeb4f 100644 --- a/lib/src/sql/statements/select.rs +++ b/lib/src/sql/statements/select.rs @@ -230,7 +230,7 @@ pub fn select(i: &str) -> IResult<&str, SelectStatement> { let (i, parallel) = opt(preceded(shouldbespace, tag_no_case("PARALLEL")))(i)?; let (i, explain) = opt(preceded(shouldbespace, explain))(i)?; let (i, _) = expected( - "one of WITH, WHERE, SPLIT, GROUP, ORDER, LIMIT, START, FETCH, VERSION, TIMEOUT, PARELLEL, or EXPLAIN", + "one of WITH, WHERE, SPLIT, GROUP, ORDER, LIMIT, START, FETCH, VERSION, TIMEOUT, PARALLEL, or EXPLAIN", cut(peek(ending::query)) )(i)?; diff --git a/lib/src/sql/util.rs b/lib/src/sql/util.rs index fc713cf8..7c3874e5 100644 --- a/lib/src/sql/util.rs +++ b/lib/src/sql/util.rs @@ -3,7 +3,7 @@ use nom::{Err, InputLength, Parser}; /// Parses a parser delimited by two other parsers. /// -/// This parser failes (not errors) if the second delimiting parser returns an error. +/// This parser fails (not errors) if the second delimiting parser returns an error. pub fn expect_delimited( mut prefix: D, mut value: V, @@ -51,10 +51,10 @@ where } } -/// Parses a delimited list with an option trailing seperator in the form of: +/// Parses a delimited list with an option trailing separator in the form of: /// ///```text -/// PREFIX $(PARSER)SEPERATOR* $(SEPERATOR)? TERMINATOR +/// PREFIX $(PARSER)SEPARATOR* $(SEPARATOR)? TERMINATOR ///``` /// /// Which parsers productions like @@ -63,14 +63,14 @@ where /// First parses the prefix and returns it's error if there is one. /// The tries to parse the terminator. If there is one the parser completes else it tries to parse /// the value, else it returns the parsed values. -/// Then it tries to parse the seperator, if there is one it start again trying to parse the +/// Then it tries to parse the separator, if there is one it start again trying to parse the /// terminator followed by a value if there is no terminator. Else it tries to parse the terminator /// and if there is none it returns a failure. Otherwise completes with an vec of the parsed /// values. /// pub fn delimited_list0( mut prefix: D, - mut seperator: S, + mut separator: S, mut value: V, mut terminator: T, ) -> impl FnMut(I) -> IResult, ParseError> @@ -96,7 +96,7 @@ where } let (i, value) = value.parse(input)?; res.push(value); - match seperator.parse(i.clone()) { + match separator.parse(i.clone()) { Ok((i, _)) => { input = i; } @@ -120,10 +120,10 @@ where } } -/// Parses a delimited list with an option trailing seperator in the form of: +/// Parses a delimited list with an option trailing separator in the form of: /// ///```text -/// PREFIX $(PARSER)SEPERATOR+ $(SEPERATOR)? TERMINATOR +/// PREFIX $(PARSER)SEPARATOR+ $(SEPARATOR)? TERMINATOR ///``` /// /// Which parsers productions like @@ -132,14 +132,14 @@ where /// First parses the prefix and returns it's error if there is one. /// The tries to parse the terminator. If there is one the parser completes else it tries to parse /// the value, else it returns the parsed values. -/// Then it tries to parse the seperator, if there is one it start again trying to parse the +/// Then it tries to parse the separator, if there is one it start again trying to parse the /// terminator followed by a value if there is no terminator. Else it tries to parse the terminator /// and if there is none it returns a failure. Otherwise completes with an vec of the parsed /// values. /// pub fn delimited_list1( mut prefix: D, - mut seperator: S, + mut separator: S, mut value: V, mut terminator: T, ) -> impl FnMut(I) -> IResult, ParseError> @@ -165,7 +165,7 @@ where } let (i, value) = value.parse(input)?; res.push(value); - match seperator.parse(i.clone()) { + match separator.parse(i.clone()) { Ok((i, _)) => { input = i; } diff --git a/lib/src/sql/value/value.rs b/lib/src/sql/value/value.rs index 96a61fe6..5795eb52 100644 --- a/lib/src/sql/value/value.rs +++ b/lib/src/sql/value/value.rs @@ -1297,7 +1297,7 @@ impl Value { Value::Number(Number::Decimal(v)) => match v.try_into() { // The Decimal can be represented as a f64 Ok(v) => Ok(v), - // Ths Decimal loses precision + // This Decimal loses precision _ => Err(Error::CoerceTo { from: self, into: "f64".into(), @@ -1373,7 +1373,7 @@ impl Value { Value::Number(Number::Decimal(ref v)) => match v.to_f64() { // The Decimal can be represented as a Float Some(v) => Ok(Number::Float(v)), - // Ths BigDecimal loses precision + // This BigDecimal loses precision None => Err(Error::CoerceTo { from: self, into: "float".into(), @@ -1396,7 +1396,7 @@ impl Value { Value::Number(Number::Int(v)) => match Decimal::from_i64(v) { // The Int can be represented as a Decimal Some(v) => Ok(Number::Decimal(v)), - // Ths Int does not convert to a Decimal + // This Int does not convert to a Decimal None => Err(Error::CoerceTo { from: self, into: "decimal".into(), @@ -1406,7 +1406,7 @@ impl Value { Value::Number(Number::Float(v)) => match Decimal::from_f64(v) { // The Float can be represented as a Decimal Some(v) => Ok(Number::Decimal(v)), - // Ths Float does not convert to a Decimal + // This Float does not convert to a Decimal None => Err(Error::CoerceTo { from: self, into: "decimal".into(), @@ -1797,7 +1797,7 @@ impl Value { Value::Strand(ref v) => match v.parse::() { // The string can be represented as a Float Ok(v) => Ok(v), - // Ths string is not a float + // This string is not a float _ => Err(Error::ConvertTo { from: self, into: "bool".into(), @@ -1832,7 +1832,7 @@ impl Value { Value::Strand(ref v) => match v.parse::() { // The string can be represented as a Float Ok(v) => Ok(Number::Int(v)), - // Ths string is not a float + // This string is not a float _ => Err(Error::ConvertTo { from: self, into: "int".into(), @@ -1867,7 +1867,7 @@ impl Value { Value::Strand(ref v) => match v.parse::() { // The string can be represented as a Float Ok(v) => Ok(Number::Float(v)), - // Ths string is not a float + // This string is not a float _ => Err(Error::ConvertTo { from: self, into: "float".into(), @@ -1890,7 +1890,7 @@ impl Value { Value::Number(Number::Int(ref v)) => match Decimal::try_from(*v) { // The Int can be represented as a Decimal Ok(v) => Ok(Number::Decimal(v)), - // Ths Int does not convert to a Decimal + // This Int does not convert to a Decimal _ => Err(Error::ConvertTo { from: self, into: "decimal".into(), @@ -1900,7 +1900,7 @@ impl Value { Value::Number(Number::Float(ref v)) => match Decimal::try_from(*v) { // The Float can be represented as a Decimal Ok(v) => Ok(Number::Decimal(v)), - // Ths Float does not convert to a Decimal + // This Float does not convert to a Decimal _ => Err(Error::ConvertTo { from: self, into: "decimal".into(), @@ -1910,7 +1910,7 @@ impl Value { Value::Strand(ref v) => match Decimal::from_str(v) { // The string can be represented as a Decimal Ok(v) => Ok(Number::Decimal(v)), - // Ths string is not a Decimal + // This string is not a Decimal _ => Err(Error::ConvertTo { from: self, into: "decimal".into(), @@ -1933,7 +1933,7 @@ impl Value { Value::Strand(ref v) => match Number::from_str(v) { // The string can be represented as a Float Ok(v) => Ok(v), - // Ths string is not a float + // This string is not a float _ => Err(Error::ConvertTo { from: self, into: "number".into(), @@ -2008,7 +2008,7 @@ impl Value { Value::Strand(ref v) => match Uuid::try_from(v.as_str()) { // The string can be represented as a uuid Ok(v) => Ok(v), - // Ths string is not a uuid + // This string is not a uuid Err(_) => Err(Error::ConvertTo { from: self, into: "uuid".into(), @@ -2031,7 +2031,7 @@ impl Value { Value::Strand(ref v) => match Datetime::try_from(v.as_str()) { // The string can be represented as a datetime Ok(v) => Ok(v), - // Ths string is not a datetime + // This string is not a datetime Err(_) => Err(Error::ConvertTo { from: self, into: "datetime".into(), @@ -2054,7 +2054,7 @@ impl Value { Value::Strand(ref v) => match Duration::try_from(v.as_str()) { // The string can be represented as a duration Ok(v) => Ok(v), - // Ths string is not a duration + // This string is not a duration Err(_) => Err(Error::ConvertTo { from: self, into: "duration".into(), @@ -2512,7 +2512,7 @@ impl Value { } } - /// Compare this Value to another Value using natrual numerical comparison + /// Compare this Value to another Value using natural numerical comparison pub fn natural_cmp(&self, other: &Value) -> Option { match (self, other) { (Value::Strand(a), Value::Strand(b)) => Some(lexicmp::natural_cmp(a, b)), @@ -2520,7 +2520,7 @@ impl Value { } } - /// Compare this Value to another Value lexicographically and using natrual numerical comparison + /// Compare this Value to another Value lexicographically and using natural numerical comparison pub fn natural_lexical_cmp(&self, other: &Value) -> Option { match (self, other) { (Value::Strand(a), Value::Strand(b)) => Some(lexicmp::natural_lexical_cmp(a, b)), diff --git a/lib/tests/api.rs b/lib/tests/api.rs index 2283ed49..dea11efe 100644 --- a/lib/tests/api.rs +++ b/lib/tests/api.rs @@ -38,7 +38,7 @@ mod api_integration { const ROOT_USER: &str = "root"; const ROOT_PASS: &str = "root"; const TICK_INTERVAL: Duration = Duration::from_secs(1); - // Used to ensure that only one test at a time is setting up the underlaying datastore. + // Used to ensure that only one test at a time is setting up the underlying datastore. // When auth is enabled, multiple tests may try to create the same root user at the same time. static SETUP_MUTEX: Lazy>> = Lazy::new(|| Arc::new(Mutex::new(()))); diff --git a/lib/tests/complex.rs b/lib/tests/complex.rs index 47d58edc..8aa53a87 100644 --- a/lib/tests/complex.rs +++ b/lib/tests/complex.rs @@ -127,7 +127,7 @@ fn ok_graph_traversal_depth() -> Result<(), Error> { ret.push_str(" AS res FROM node:0;\n"); ret } - // Test different traveral depths + // Test different traversal depths for n in 1..=40 { // Ensure a good stack size for tests with_enough_stack(async move { diff --git a/lib/tests/future.rs b/lib/tests/future.rs index 0e5a799e..4f74d2fd 100644 --- a/lib/tests/future.rs +++ b/lib/tests/future.rs @@ -89,7 +89,7 @@ async fn concurrency() -> Result<(), Error> { ) } - /// Returns `true` iif `limit` futures are concurrently executed. + /// Returns `true` if `limit` futures are concurrently executed. async fn test_limit(limit: usize) -> Result { let sql = query(limit, MILLIS); let dbs = new_ds().await?; diff --git a/src/net/client_ip.rs b/src/net/client_ip.rs index e2733997..8f96a9e5 100644 --- a/src/net/client_ip.rs +++ b/src/net/client_ip.rs @@ -24,7 +24,7 @@ pub enum ClientIp { Socket, /// Cloudflare connecting IP #[clap(name = "CF-Connecting-IP")] - CfConectingIp, + CfConnectingIp, /// Fly.io client IP #[clap(name = "Fly-Client-IP")] FlyClientIp, @@ -44,7 +44,7 @@ impl std::fmt::Display for ClientIp { match self { ClientIp::None => write!(f, "None"), ClientIp::Socket => write!(f, "Socket"), - ClientIp::CfConectingIp => write!(f, "CF-Connecting-IP"), + ClientIp::CfConnectingIp => write!(f, "CF-Connecting-IP"), ClientIp::FlyClientIp => write!(f, "Fly-Client-IP"), ClientIp::TrueClientIP => write!(f, "True-Client-IP"), ClientIp::XRealIp => write!(f, "X-Real-IP"), @@ -58,7 +58,7 @@ impl ClientIp { match self { ClientIp::None => false, ClientIp::Socket => false, - ClientIp::CfConectingIp => true, + ClientIp::CfConnectingIp => true, ClientIp::FlyClientIp => true, ClientIp::TrueClientIP => true, ClientIp::XRealIp => true,