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

feature: support smol_str #350

Merged

Conversation

corvusrabus
Copy link
Contributor

Goal

Add support for the widely used string crate smol_str (15m downloads from crates.io).
The main and only type in the crate is SmolStr which is essentially a string with some optimisations.

Checklist

  • I have followed the steps listed in the Contributing guide.
  • If necessary, I have added documentation related to the changes made.
  • I have added or updated the tests related to the changes made.

@gustavo-shigueo
Copy link
Collaborator

Hi @corvusrabus, thanks for the PR! Can you add a quick test for it please? That'll help avoid regressions in the future

@corvusrabus
Copy link
Contributor Author

Thanks @gustavo-shigueo. Sure I can do that but I don't see tests for any of the other similar fundamental datatypes like uuid-impl, bigdecimal-impl, ... either. Is it necessary?

@gustavo-shigueo
Copy link
Collaborator

gustavo-shigueo commented Sep 6, 2024

I wouldn't say it's necessary - I mean, it's just a string, not much to break there lol -, but I do think it's a good idea. Also, thanks for pointing out those missing tests! I'll try to find some time to add them in the weekend

@corvusrabus
Copy link
Contributor Author

@gustavo-shigueo. I'll add them if you haven't done it yet

@corvusrabus
Copy link
Contributor Author

Added tests @gustavo-shigueo

@gustavo-shigueo
Copy link
Collaborator

Awesome! Thank you so much @corvusrabus

@gustavo-shigueo gustavo-shigueo merged commit 7577aca into Aleph-Alpha:main Sep 7, 2024
9 checks passed
@@ -86,6 +86,7 @@ When running `cargo test`, the TypeScript bindings will be exported to the file
| ordered-float-impl | Implement `TS` for types from *ordered_float* |
| heapless-impl | Implement `TS` for types from *heapless* |
| semver-impl | Implement `TS` for types from *semver* |
| smol_str-impl | Implement `TS` for types from *smol_str* |
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here, the feature is called smol_str-impl, but it's actually smolstr-impl in Cargo.toml.

I'd prefer smol_str-impl everywhere, since that matches the <crate name>-impl naming scheme we've got going on here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure thing. I'll add it to this one #351

@NyxCode
Copy link
Collaborator

NyxCode commented Sep 7, 2024

@gustavo-shigueo there seems to be some CI failures on master

@gustavo-shigueo
Copy link
Collaborator

Oops, I missed on smolstr-impl

@gustavo-shigueo gustavo-shigueo added the enhancement New feature or request label Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants