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

refactor: standardizes Property::new and Property::new_pre_alloc methods with generics #108

Merged
merged 5 commits into from
Aug 26, 2024

Conversation

marcantoinem
Copy link
Contributor

Another little PR, but it is only to make the user interface a bit nicer to work with.

It allows to use the same function for owned String and slices. By using impl Into<String>, it convert string slices to String when it receives a string slices, but when a String is passed, it will just move it. The implementation of Into for the same type is a function that just return the same type, so it's a zero cost operation. https://doc.rust-lang.org/src/core/convert/mod.rs.html#763-771

I marked the old method deprecated, so at the next major release with breaking changes, they could be removed.

@marcantoinem marcantoinem force-pushed the refactor/pre-alloc-removal branch from e455add to 2d2b427 Compare August 25, 2024 21:56
@hoodie hoodie merged commit 4cabe90 into hoodie:main Aug 26, 2024
7 checks passed
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