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

Queue::write_buffer_with() should precisely document its Option return #7075

Open
kpreid opened this issue Feb 7, 2025 · 0 comments
Open
Labels
area: documentation Documentation for crate items, public or private type: enhancement New feature or request

Comments

@kpreid
Copy link
Contributor

kpreid commented Feb 7, 2025

Queue::write_buffer_with() returns Option<QueueWriteBufferView<'a>>. Looking at the source, the Option is None on some error conditions. This is unusual, and not clearly documented. I presume the reason write_buffer_with() works this way is that if any error occurs, it can't return a functional QueueWriteBufferView. But in that case, the question remains: is the error also being reported to the error scope? If yes, then callers can just use if let Some(view) = write_buffer_with() { ... do stuff ... }; if no, then they may need to do additional handling.

The return type of write_buffer_with() should be clearly documented so that it can be handled appropriately.

@cwfitzgerald cwfitzgerald added type: enhancement New feature or request area: documentation Documentation for crate items, public or private labels Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: documentation Documentation for crate items, public or private type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants