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

Extend cstr8! to accept [u8] and CStr checked at compile time #3

Merged
merged 1 commit into from
Mar 4, 2024

Conversation

kupiakos
Copy link
Contributor

@kupiakos kupiakos commented Mar 3, 2024

Extend cstr8! to accept all of these types:

  • &str
  • &CStr
  • &[u8]
  • &[u8; N]
  • [u8; N]

@kupiakos kupiakos changed the title Extend cstr8! to accept [u8] and CStr checked at compile time Extend cstr8! to accept [u8] and CStr checked at compile time Mar 3, 2024
Copy link
Owner

@CAD97 CAD97 left a comment

Choose a reason for hiding this comment

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

I just have some minor style notes on the docs, but I'll tweak that myself before publishing. Thanks for the improvements!

I'm a little embarrassed that, buried in more advanced macro specialization techniques, I forgot that just making multiple implementations on a generic is sufficient for concretely finite sets of types 🙃 (although in my defense it's generally a good idea to avoid this kind of overloading in APIs such that Type::method is a single item)

@CAD97 CAD97 merged commit 6b90f2c into CAD97:main Mar 4, 2024
3 checks passed
@CAD97
Copy link
Owner

CAD97 commented Apr 13, 2024

Released in version 0.1.4 🎉

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