diff --git a/README.md b/README.md index c9763a3..df355b9 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ fn main() { float_reference_builder: |float_data: &mut f32| float_data, }.build(); - // The fields in the original struct can not be accesed directly + // The fields in the original struct can not be accessed directly // The builder creates accessor methods which are called borrow_{field_name}() // Prints 42 diff --git a/ouroboros/src/lib.rs b/ouroboros/src/lib.rs index db6d5c5..0184e33 100644 --- a/ouroboros/src/lib.rs +++ b/ouroboros/src/lib.rs @@ -39,7 +39,7 @@ /// float_reference_builder: |float_data: &mut f32| float_data, /// }.build(); /// -/// // The fields in the original struct can not be accesed directly +/// // The fields in the original struct can not be accessed directly /// // The builder creates accessor methods which are called borrow_{field_name}() /// /// // Prints 42 @@ -303,12 +303,12 @@ /// ### `MyStructAsyncSendBuilder` /// Same as MyStructAsyncBuilder, but with Send trait specified in the return type. /// ### `MyStruct::try_new(fields...) -> Result` -/// Similar to the regular `new()` function, except the functions wich create values for all +/// Similar to the regular `new()` function, except the functions which create values for all /// **self-referencing fields** can return `Result<>`s. If any of those are `Err`s, that error will be /// returned instead of an instance of `MyStruct`. The preferred way to use this function is through /// `MyStructTryBuilder` and its `try_build()` function. /// ### `MyStruct::try_new_async(fields...) -> Result` -/// Similar to the regular `new_async()` function, except the functions wich create values for all +/// Similar to the regular `new_async()` function, except the functions which create values for all /// **self-referencing fields** can return `Result<>`s. If any of those are `Err`s, that error will be /// returned instead of an instance of `MyStruct`. The preferred way to use this function is through /// `MyStructAsyncTryBuilder` and its `try_build()` function. diff --git a/ouroboros_macro/src/generate/constructor.rs b/ouroboros_macro/src/generate/constructor.rs index 60583d8..a4f4f01 100644 --- a/ouroboros_macro/src/generate/constructor.rs +++ b/ouroboros_macro/src/generate/constructor.rs @@ -46,7 +46,7 @@ pub fn create_builder_and_constructor( .to_owned(); let build_fn_documentation = format!( concat!( - "Calls [`{0}::new()`]({0}::new) using the provided values. This is preferrable over ", + "Calls [`{0}::new()`]({0}::new) using the provided values. This is preferable over ", "calling `new()` directly for the reasons listed above. " ), info.ident.to_string() @@ -80,7 +80,7 @@ pub fn create_builder_and_constructor( ); } else if let ArgType::TraitBound(bound_type) = arg_type { // Trait bounds are much trickier. We need a special syntax to accept them in the - // contructor, and generic parameters need to be added to the builder struct to make + // constructor, and generic parameters need to be added to the builder struct to make // it work. let builder_name = field.builder_name(); params.push(quote! { #builder_name : impl #bound_type }); diff --git a/ouroboros_macro/src/generate/summon_checker.rs b/ouroboros_macro/src/generate/summon_checker.rs index 743c199..7e7ab28 100644 --- a/ouroboros_macro/src/generate/summon_checker.rs +++ b/ouroboros_macro/src/generate/summon_checker.rs @@ -18,7 +18,7 @@ pub fn generate_checker_summoner(info: &StructInfo) -> Result Result Result { } // We should not be able to access the field outside of the hidden module where // everything is generated. - let with_vis = submodule_contents_visiblity(&field.vis.clone()); + let with_vis = submodule_contents_visibility(&field.vis.clone()); fields.push(StructFieldInfo { name: field.ident.clone().expect("Named field has no name."), typ: field.ty.clone(), diff --git a/ouroboros_macro/src/utils.rs b/ouroboros_macro/src/utils.rs index 3b1f770..737893a 100644 --- a/ouroboros_macro/src/utils.rs +++ b/ouroboros_macro/src/utils.rs @@ -90,7 +90,7 @@ pub fn replace_this_with_lifetime(input: TokenStream, lifetime: Ident) -> TokenS .collect() } -pub fn submodule_contents_visiblity(original_visibility: &Visibility) -> Visibility { +pub fn submodule_contents_visibility(original_visibility: &Visibility) -> Visibility { match original_visibility { // inherited: allow parent of inner submodule to see Visibility::Inherited => syn::parse_quote! { pub(super) },