Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Casing namespace #145

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

nojaf
Copy link

@nojaf nojaf commented Nov 29, 2024

Fixes #144

I have very little idea what I'm doing here.
I don't know any Rust and just tried the hint of @tsnobip in #144 (comment)

@@ -312,7 +333,7 @@ impl Config {
namespace if namespace.is_case(Case::UpperFlat) => {
packages::Namespace::Namespace(namespace.to_string())
}
namespace => packages::Namespace::Namespace(namespace.to_string().to_case(Case::Pascal)),
namespace => packages::Namespace::Namespace(namespace_from_package_name(namespace)),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is another use of to_case(Case::Pascal) on line 348, but actually I think you can simplify this match quite a lot and always process namespace whatever the initial case with this new function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Casing in namespace is not respected
2 participants