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

feat(ascii): parse multi-byte unicode chars correctly + docs #936

Merged
merged 6 commits into from
Jan 19, 2023

Conversation

ozwaldorf
Copy link
Contributor

@ozwaldorf ozwaldorf commented Jan 19, 2023

Why

resolves #935

What

  • take next char and return the remainder, instead of pulling next char and returning a slice of the input
  • add unicode render assertion to tests
  • add AsciiArt usage example
  • add badges to ascii/README.md

Demo

Usage

image

Docs

image

@ozwaldorf ozwaldorf changed the title fix: parse multi-byte unicode chars correctly fix(ascii): parse multi-byte unicode chars correctly Jan 19, 2023
Copy link
Collaborator

@spenserblack spenserblack left a comment

Choose a reason for hiding this comment

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

Thanks, looks good!

I'm sure this resolves your issue, but would you want to add a test for it, and reference your issue?

// https://github.com/o2sh/onefetch/issues/935
#[test]
fn test_multi_byte_tokens() {
    // ...
}

Copy link
Collaborator

@spenserblack spenserblack left a comment

Choose a reason for hiding this comment

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

Awesome, thanks for adding tests and docs!

One last nitpick:

ascii/src/lib.rs Outdated Show resolved Hide resolved
@ozwaldorf
Copy link
Contributor Author

ozwaldorf commented Jan 19, 2023

Also added badges to the readme, so as to have a direction to the docs.rs/crates.io pages from the repo. To note, it will show not found until there's a release 🙂

@ozwaldorf ozwaldorf changed the title fix(ascii): parse multi-byte unicode chars correctly chore(ascii): parse multi-byte unicode chars correctly + docs Jan 19, 2023
@ozwaldorf ozwaldorf changed the title chore(ascii): parse multi-byte unicode chars correctly + docs feat(ascii): parse multi-byte unicode chars correctly + docs Jan 19, 2023
Copy link
Collaborator

@spenserblack spenserblack left a comment

Choose a reason for hiding this comment

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

🚀

@ozwaldorf
Copy link
Contributor Author

ozwaldorf commented Jan 19, 2023

If it's possible, it'd be really nice for this crate to get published asap once merged, so that I can release punfetch with the integrations for color support. Even if it's a -alpha release 🙏

@o2sh o2sh merged commit 5cc8ea6 into o2sh:main Jan 19, 2023
@ozwaldorf ozwaldorf deleted the fix/unicode-ascii branch January 19, 2023 18:06
@o2sh
Copy link
Owner

o2sh commented Jan 19, 2023

If it's possible, it'd be really nice for this crate to get published asap once merged,

done: https://crates.io/crates/onefetch-ascii

@o2sh o2sh mentioned this pull request Mar 22, 2023
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.

onefetch_ascii: unicode chars causing panic
3 participants