Skip to content

Commit

Permalink
Merge pull request #113 from Sajjon/fix_typos
Browse files Browse the repository at this point in the history
Слава Україні!
  • Loading branch information
greyblake authored Dec 11, 2023
2 parents aed37c1 + 783734e commit 80aafef
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ But I am Ukrainian. The first 25 years of my life I spent in [Kharkiv](https://e
the second-largest city in Ukraine, 60km away from the border with russia. Today about [a third of my home city is destroyed](https://www.youtube.com/watch?v=ihoufBFSZds) by russians.
My parents, my relatives and my friends had to survive the artillery and air attack, living for over a month in basements.

Some of them have managed to evacuate to EU. Some others are trying to live "normal lifes" in Kharkiv, doing there daily duties.
Some of them have managed to evacuate to EU. Some others are trying to live "normal lives" in Kharkiv, doing there daily duties.
And some are at the front line right now, risking their lives every second to protect the rest.

I encourage you to donate to [Charity foundation of Serhiy Prytula](https://prytulafoundation.org/en).
Expand Down
4 changes: 2 additions & 2 deletions WORKLOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

### TODO Refactor:
* Refactor parsers
* Try to generelize the parsing, validation and generation over types
* Try to generalize the parsing, validation and generation over types

### TODO UI:
* UI: Impl "did you mean" hints:
Expand Down Expand Up @@ -34,7 +34,7 @@
* truncate
* Remove extra spaces
* Extra validations for floats:
* `is_number` / `is_finite` (aka not NaN, and not `Inifinity`)
* `is_number` / `is_finite` (aka not NaN, and not `Infinity`)
* This should allow to derive Eq and Ord
* Consider extending errors to keep the invalid value?

Expand Down
2 changes: 1 addition & 1 deletion nutype/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@
//! the second-largest city in Ukraine, 60km away from the border with russia. Today about [a third of my home city is destroyed](https://www.youtube.com/watch?v=ihoufBFSZds) by russians.
//! My parents, my relatives and my friends had to survive the artillery and air attack, living for over a month in basements.
//!
//! Some of them have managed to evacuate to EU. Some others are trying to live "normal lifes" in Kharkiv, doing there daily duties.
//! Some of them have managed to evacuate to EU. Some others are trying to live "normal lives" in Kharkiv, doing there daily duties.
//! And some are at the front line right now, risking their lives every second to protect the rest.
//!
//! I encourage you to donate to [Charity foundation of Serhiy Prytula](https://prytulafoundation.org/en).
Expand Down
4 changes: 2 additions & 2 deletions nutype_macros/src/any/gen/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::{
common::{
gen::traits::{
gen_impl_trait_as_ref, gen_impl_trait_borrow, gen_impl_trait_default,
gen_impl_trait_deref, gen_impl_trait_dislpay, gen_impl_trait_from,
gen_impl_trait_deref, gen_impl_trait_display, gen_impl_trait_from,
gen_impl_trait_from_str, gen_impl_trait_into, gen_impl_trait_serde_deserialize,
gen_impl_trait_serde_serialize, gen_impl_trait_try_from, split_into_generatable_traits,
GeneratableTrait, GeneratableTraits, GeneratedTraits,
Expand Down Expand Up @@ -144,7 +144,7 @@ fn gen_implemented_traits(
AnyIrregularTrait::AsRef => gen_impl_trait_as_ref(type_name, inner_type),
AnyIrregularTrait::From => gen_impl_trait_from(type_name, inner_type),
AnyIrregularTrait::Into => gen_impl_trait_into(type_name, inner_type.clone()),
AnyIrregularTrait::Display => gen_impl_trait_dislpay(type_name),
AnyIrregularTrait::Display => gen_impl_trait_display(type_name),
AnyIrregularTrait::Deref => gen_impl_trait_deref(type_name, inner_type),
AnyIrregularTrait::Borrow => gen_impl_trait_borrow(type_name, inner_type),
AnyIrregularTrait::FromStr => {
Expand Down
8 changes: 4 additions & 4 deletions nutype_macros/src/any/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ impl Parse for SpannedAnySanitizer {
AnySanitizerKind::With => {
let _eq: Token![=] = input.parse()?;
let span = input.span();
let custom_funciton: CustomFunction = input.parse()?;
let custom_function: CustomFunction = input.parse()?;
Ok(SpannedAnySanitizer {
item: AnySanitizer::With(custom_funciton),
item: AnySanitizer::With(custom_function),
span,
})
}
Expand All @@ -67,9 +67,9 @@ impl Parse for SpannedAnyValidator {
AnyValidatorKind::Predicate => {
let _eq: Token![=] = input.parse()?;
let span = input.span();
let custom_funciton: CustomFunction = input.parse()?;
let custom_function: CustomFunction = input.parse()?;
Ok(SpannedAnyValidator {
item: AnyValidator::Predicate(custom_funciton),
item: AnyValidator::Predicate(custom_function),
span,
})
}
Expand Down
2 changes: 1 addition & 1 deletion nutype_macros/src/common/gen/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ pub fn gen_impl_trait_deref(type_name: &TypeName, inner_type: impl ToTokens) ->
}
}

pub fn gen_impl_trait_dislpay(type_name: &TypeName) -> TokenStream {
pub fn gen_impl_trait_display(type_name: &TypeName) -> TokenStream {
quote! {
impl ::core::fmt::Display for #type_name {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
Expand Down
2 changes: 1 addition & 1 deletion nutype_macros/src/common/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ macro_rules! define_ident_type {
// For example: `Username`, `Email`, etc.
define_ident_type!(TypeName);

// Repesents a type for a validation error.
// Represents a type for a validation error.
// For example, if `TypeName` is `Email`, then `ErrorTypeName` would usually be `EmailError`.
define_ident_type!(ErrorTypeName);

Expand Down
6 changes: 3 additions & 3 deletions nutype_macros/src/float/gen/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::{
common::{
gen::traits::{
gen_impl_trait_as_ref, gen_impl_trait_borrow, gen_impl_trait_default,
gen_impl_trait_deref, gen_impl_trait_dislpay, gen_impl_trait_from,
gen_impl_trait_deref, gen_impl_trait_display, gen_impl_trait_from,
gen_impl_trait_from_str, gen_impl_trait_into, gen_impl_trait_serde_deserialize,
gen_impl_trait_serde_serialize, gen_impl_trait_try_from, split_into_generatable_traits,
GeneratableTrait, GeneratableTraits, GeneratedTraits,
Expand Down Expand Up @@ -168,7 +168,7 @@ fn gen_implemented_traits(
gen_impl_trait_try_from(type_name, inner_type, maybe_error_type_name.as_ref())
}
FloatIrregularTrait::Borrow => gen_impl_trait_borrow(type_name, inner_type),
FloatIrregularTrait::Display => gen_impl_trait_dislpay(type_name),
FloatIrregularTrait::Display => gen_impl_trait_display(type_name),
FloatIrregularTrait::Default => match maybe_default_value {
Some(ref default_value) => {
let has_validation = maybe_error_type_name.is_some();
Expand Down Expand Up @@ -200,7 +200,7 @@ fn gen_impl_trait_eq(type_name: &TypeName) -> TokenStream {

// The implementation below may panic.
// Function `partial_cmp` returns `None` only for `NaN` values, but
// `NaN` values are supposed to be exluded by `finite` validation rule.
// `NaN` values are supposed to be excluded by `finite` validation rule.
// Without `finite` validation deriving `Ord` is not allowed.
fn gen_impl_trait_ord(type_name: &TypeName) -> TokenStream {
let tp = type_name.to_string();
Expand Down
4 changes: 2 additions & 2 deletions nutype_macros/src/integer/gen/traits/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::{
common::{
gen::traits::{
gen_impl_trait_as_ref, gen_impl_trait_borrow, gen_impl_trait_default,
gen_impl_trait_deref, gen_impl_trait_dislpay, gen_impl_trait_from,
gen_impl_trait_deref, gen_impl_trait_display, gen_impl_trait_from,
gen_impl_trait_from_str, gen_impl_trait_into, gen_impl_trait_serde_deserialize,
gen_impl_trait_serde_serialize, gen_impl_trait_try_from, split_into_generatable_traits,
GeneratableTrait, GeneratableTraits, GeneratedTraits,
Expand Down Expand Up @@ -196,7 +196,7 @@ fn gen_implemented_traits<T: ToTokens>(
Ok(gen_impl_trait_try_from(type_name, inner_type, maybe_error_type_name.as_ref()))
}
IntegerIrregularTrait::Borrow => Ok(gen_impl_trait_borrow(type_name, inner_type)),
IntegerIrregularTrait::Display => Ok(gen_impl_trait_dislpay(type_name)),
IntegerIrregularTrait::Display => Ok(gen_impl_trait_display(type_name)),
IntegerIrregularTrait::Default => {
match maybe_default_value {
Some(ref default_value) => {
Expand Down
4 changes: 2 additions & 2 deletions nutype_macros/src/string/gen/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::{
common::{
gen::traits::{
gen_impl_trait_as_ref, gen_impl_trait_borrow, gen_impl_trait_default,
gen_impl_trait_deref, gen_impl_trait_dislpay, gen_impl_trait_from, gen_impl_trait_into,
gen_impl_trait_deref, gen_impl_trait_display, gen_impl_trait_from, gen_impl_trait_into,
gen_impl_trait_serde_deserialize, gen_impl_trait_serde_serialize,
gen_impl_trait_try_from, split_into_generatable_traits, GeneratableTrait,
GeneratableTraits, GeneratedTraits,
Expand Down Expand Up @@ -181,7 +181,7 @@ fn gen_implemented_traits(
gen_impl_try_from(type_name, maybe_error_type_name.as_ref())
}
StringIrregularTrait::Borrow => gen_impl_borrow_str_and_string(type_name),
StringIrregularTrait::Display => gen_impl_trait_dislpay(type_name),
StringIrregularTrait::Display => gen_impl_trait_display(type_name),
StringIrregularTrait::Default => match maybe_default_value {
Some(ref default_value) => {
let has_validation = maybe_error_type_name.is_some();
Expand Down
4 changes: 2 additions & 2 deletions test_suite/tests/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ mod validators {
assert_eq!(Name::new("Anton").unwrap().into_inner(), "Anton");
assert_eq!(Name::new("Serhii"), Err(NameError::LenCharMaxViolated));

// Ukranian, Cyrillic. Every char is 2 bytes.
// Ukrainian, Cyrillic. Every char is 2 bytes.
assert_eq!(Name::new("Антон").unwrap().into_inner(), "Антон");
}

Expand All @@ -113,7 +113,7 @@ mod validators {
assert_eq!(Name::new("Anton"), Err(NameError::LenCharMinViolated));
assert_eq!(Name::new("Serhii").unwrap().into_inner(), "Serhii");

// Ukranian, Cyrillic. Every char is 2 bytes.
// Ukrainian, Cyrillic. Every char is 2 bytes.
assert_eq!(Name::new("Антон"), Err(NameError::LenCharMinViolated));
}

Expand Down

0 comments on commit 80aafef

Please sign in to comment.