From d2454846eb62f020df88c1396856746900d978d6 Mon Sep 17 00:00:00 2001 From: Sakshi Rai Date: Sat, 6 Sep 2025 23:06:20 +0530 Subject: [PATCH] fix(builder): correct visibility spelling in struct generation - Fix typo 'visiblity' to 'visibility' in StructBuilder implementation - Correct spelling in the query implementation to use 'visibility' - Update README and lib comments to fix 'visibility' typo - Ensure consistent naming for visibility modifiers throughout codebase Bug; T201491 --- mwapi/README.md | 2 +- mwapi/src/lib.rs | 2 +- mwapi_responses_derive/src/builder.rs | 4 ++-- mwapi_responses_derive/src/lib.rs | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mwapi/README.md b/mwapi/README.md index 9dd3fb3a..6f81925b 100644 --- a/mwapi/README.md +++ b/mwapi/README.md @@ -17,7 +17,7 @@ which builds on top of this crate. or writing a bot * fully compatible with concurrent use cases * turns MediaWiki errors into Rust errors for you -* logging (using the `tracing` crate) for visiblity into errors +* logging (using the `tracing` crate) for visibility into errors * follow all [best practices](https://www.mediawiki.org/wiki/API:Etiquette) ### Quick start diff --git a/mwapi/src/lib.rs b/mwapi/src/lib.rs index 51e93793..06167a79 100644 --- a/mwapi/src/lib.rs +++ b/mwapi/src/lib.rs @@ -26,7 +26,7 @@ along with this program. If not, see . //! or writing a bot //! * fully compatible with concurrent use cases //! * turns MediaWiki errors into Rust errors for you -//! * logging (using the `tracing` crate) for visiblity into errors +//! * logging (using the `tracing` crate) for visibility into errors //! * follow all [best practices](https://www.mediawiki.org/wiki/API:Etiquette) //! //! ## Quick start diff --git a/mwapi_responses_derive/src/builder.rs b/mwapi_responses_derive/src/builder.rs index a10a1691..c38b846c 100644 --- a/mwapi_responses_derive/src/builder.rs +++ b/mwapi_responses_derive/src/builder.rs @@ -29,7 +29,7 @@ pub(crate) struct StructBuilder { impl ToTokens for StructBuilder { fn to_tokens(&self, tokens: &mut TokenStream2) { let ident = &self.ident; - let visiblity = &self.visibility; + let visibility = &self.visibility; let extra_derive = &self.extra_derive; let fields = &self.fields; let stream = quote! { @@ -37,7 +37,7 @@ impl ToTokens for StructBuilder { #extra_derive #[derive(Debug, Clone, ::mwapi_responses::serde::Deserialize)] #[serde(crate = "::mwapi_responses::serde")] - #visiblity struct #ident { + #visibility struct #ident { #(#fields)* } }; diff --git a/mwapi_responses_derive/src/lib.rs b/mwapi_responses_derive/src/lib.rs index 68ec366a..97e80b2a 100644 --- a/mwapi_responses_derive/src/lib.rs +++ b/mwapi_responses_derive/src/lib.rs @@ -149,10 +149,10 @@ fn impl_query( qparams: &ParsedParams, ) -> Result { let prefix = &input.ident; - let visiblity = &input.vis; + let visibility = &input.vis; let body_ident = format_ident!("{}Body", prefix); let (mut structs, item_fieldname, item_ident) = - build_modules(prefix, visiblity, &body_ident, qparams)?; + build_modules(prefix, visibility, &body_ident, qparams)?; let item_fieldname = format_ident!("{}", item_fieldname); // Add the main struct structs.push(StructBuilder { @@ -183,7 +183,7 @@ fn impl_query( deserialize_with: None, }, ], - visibility: visiblity.clone(), + visibility: visibility.clone(), extra_derive: None, }); -- GitLab