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

Fix panic with byte indexes #103

Merged
merged 1 commit into from
Mar 8, 2024
Merged

Fix panic with byte indexes #103

merged 1 commit into from
Mar 8, 2024

Conversation

adampetro
Copy link
Contributor

Fix a panic when the byte index is the end of the source, and the last character of the source is a newline.

With only the test addition and not the code change, the test fails with a panic:

failures:

---- write::tests::label_of_width_zero_at_end_of_line stdout ----
thread 'write::tests::label_of_width_zero_at_end_of_line' panicked at src/write.rs:84:59:
byte index 9 is out of bounds of `apple ==`

@zesterer
Copy link
Owner

zesterer commented Mar 8, 2024

Thanks!

@zesterer zesterer merged commit 8b6a08b into zesterer:main Mar 8, 2024
1 check passed
@adampetro adampetro deleted the fix-panic branch March 11, 2024 14:21
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