Fix typos (#2764)
This commit is contained in:
parent
67fa54d792
commit
74ad693709
32 changed files with 71 additions and 71 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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",
|
||||
))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<R>(Receiver<R>);
|
||||
|
||||
impl<R> Stream for ChannelStream<R> {
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ impl Hb {
|
|||
}
|
||||
|
||||
pub fn suffix(ts: &Timestamp) -> Vec<u8> {
|
||||
// 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,
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -360,7 +360,7 @@ impl Intersect<Self> for Array {
|
|||
|
||||
// Documented with the assumption that it is just for arrays.
|
||||
pub(crate) trait Matches<T> {
|
||||
/// 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))`
|
||||
|
|
|
@ -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 `::`"
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -57,7 +57,7 @@ where
|
|||
}
|
||||
|
||||
pub trait ExplainResultExt<I, O> {
|
||||
/// 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<P, O1>(self, explain: &'static str, condition: P) -> Self
|
||||
where
|
||||
|
|
|
@ -794,7 +794,7 @@ fn polygon_vals(i: &str) -> IResult<&str, Polygon<f64>> {
|
|||
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)))
|
||||
}
|
||||
|
|
|
@ -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),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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")))),
|
||||
|
|
|
@ -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)?;
|
||||
|
||||
|
|
|
@ -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<I, D, V, T, O, O1>(
|
||||
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<I, D, S, V, T, O, O1, O2>(
|
||||
mut prefix: D,
|
||||
mut seperator: S,
|
||||
mut separator: S,
|
||||
mut value: V,
|
||||
mut terminator: T,
|
||||
) -> impl FnMut(I) -> IResult<I, Vec<O>, ParseError<I>>
|
||||
|
@ -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<I, D, S, V, T, O, O1, O2>(
|
||||
mut prefix: D,
|
||||
mut seperator: S,
|
||||
mut separator: S,
|
||||
mut value: V,
|
||||
mut terminator: T,
|
||||
) -> impl FnMut(I) -> IResult<I, Vec<O>, ParseError<I>>
|
||||
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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::<bool>() {
|
||||
// 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::<i64>() {
|
||||
// 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::<f64>() {
|
||||
// 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<Ordering> {
|
||||
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<Ordering> {
|
||||
match (self, other) {
|
||||
(Value::Strand(a), Value::Strand(b)) => Some(lexicmp::natural_lexical_cmp(a, b)),
|
||||
|
|
|
@ -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<Arc<Mutex<()>>> = Lazy::new(|| Arc::new(Mutex::new(())));
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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<bool, Error> {
|
||||
let sql = query(limit, MILLIS);
|
||||
let dbs = new_ds().await?;
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue