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

Added AsXxxCase wrappers #33

Merged
merged 1 commit into from
Aug 12, 2021
Merged

Conversation

SOF3
Copy link
Contributor

@SOF3 SOF3 commented Jul 15, 2021

Given camel: &str, snake: &str, the following line allocates 3 Strings:

format!("Camel is {} and snake is {}", camel.to_camel_case(), snake.to_snake_case())

Instead, I can write this to allocate only one String

println!("Camel is {} and snake is {}", AsCamelCase(camel), AsSnakeCase(snake));

@SOF3
Copy link
Contributor Author

SOF3 commented Jul 15, 2021

I just realized I am using an old base. I'll rebase it later after the changes are approved.

@jplatte
Copy link
Collaborator

jplatte commented Jul 15, 2021

I like the idea, though don't have time to review right now. Will try to get to this soon-ish.

Copy link
Collaborator

@jplatte jplatte left a comment

Choose a reason for hiding this comment

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

Sorry for the long delay. Changes are looking good!

@SOF3
Copy link
Contributor Author

SOF3 commented Jul 31, 2021

Rebased.

pub use title::{AsTitleCase, ToTitleCase};
pub use upper_camel::{
AsUpperCamelCase, AsUpperCamelCase as AsPascalCase, ToPascalCase, ToUpperCamelCase,
};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would have actually preferred simply doing pub use upper_camel::*; here though.

@jplatte jplatte merged commit 2e59d88 into withoutboats:master Aug 12, 2021
@SOF3 SOF3 deleted the as-str-wrapper branch August 12, 2021 09:44
@SOF3
Copy link
Contributor Author

SOF3 commented Oct 9, 2021

When are you going to publish a release containing this update?

@jplatte
Copy link
Collaborator

jplatte commented Oct 11, 2021

I'm not sure it makes sense to release 0.4.0 before #26 is done, but this project is overall very low on my todo list. I guess this could go into 0.3.4 though. Can you rebase this on top of the v0.3.x branch and open another PR with that?

If you care, finishing #27 would be another nice to have for v0.3.x, seems like the original author has disappeared.

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.

2 participants