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

provide as_string() method to return the alphabet characters #264

Merged
merged 5 commits into from Jan 11, 2024

Conversation

JosiahParry
Copy link
Contributor

This PR provides a method to return the characters in the Alphabet struct as a String.

At present, there is no provided way to retrieve characters that were used to create the alphabet. One way to accomplish this today, is to capture the output of the Debug format and process it manually. This as_string() method will make it easier to do just that. Alternatively, if the symbols field of the struct was made public, the onus could be put on the users of the crate to iterate through the array and cast u8 as char.

As an alternative to a GH issue, I wanted to provide a PR instead. Please let me know if this suffices.

@JosiahParry
Copy link
Contributor Author

Firs time contributing to something with no_std I think i got the cfg correct :P

Copy link
Owner

@marshallpierce marshallpierce left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! I've suggested a simplification (and it looks like you did get the attributes right, but you won't need them after all).

src/alphabet.rs Outdated Show resolved Hide resolved
src/alphabet.rs Outdated Show resolved Hide resolved
@JosiahParry
Copy link
Contributor Author

JosiahParry commented Jan 11, 2024

CI Gods are pleased 👼🏼

@marshallpierce marshallpierce merged commit 08deccf into marshallpierce:master Jan 11, 2024
5 checks passed
@marshallpierce
Copy link
Owner

Released as 0.21.7

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.

None yet

2 participants