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

remove a todo #202

Merged
merged 1 commit into from
Jan 19, 2025
Merged

remove a todo #202

merged 1 commit into from
Jan 19, 2025

Conversation

yshavit
Copy link
Owner

@yshavit yshavit commented Jan 19, 2025

I looked into it, and replacing the callback for without_wrapping with a PreWriter (or even just a W) wouldn't be worth it. I'd still have to borrow against self.words_buffer, unless I wanted an even more complicated thing where the writes happen and then report back to the WordsBuffer how many chars go written without wrapping. That's certainly possible, but more complicated than I think is worthwhile.

Instead, I added #[must_use] to the return of set_word_boundary. That gives me decent (if not perfect) protection against forgetting to restore it, and keeps things simple.

While I was here, I cleaned up a bunch of <W> ... where W:'s, and turned them into impl.

@yshavit yshavit merged commit 0e53724 into main Jan 19, 2025
4 checks passed
@yshavit yshavit deleted the pre-writer branch January 19, 2025 05:34
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.

1 participant