Skip to content

Buf::try_advance support #786

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

Open
Tom01098 opened this issue May 24, 2025 · 0 comments
Open

Buf::try_advance support #786

Tom01098 opened this issue May 24, 2025 · 0 comments

Comments

@Tom01098
Copy link

Buf::advance is a required method and panics if it runs out of bytes. It would be useful to have a similar functionality which doesn't panic, returning a TryGetError.

Buf::try_advance could be the required method instead of Buf::advance, with the latter being a wrapper on top of the former which just unwraps and panics. This may be undesirable as it would break all implementations!

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

No branches or pull requests

1 participant