-
Notifications
You must be signed in to change notification settings - Fork 69
Rename buffer_mut to next_buffer
#337
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
base: master
Are you sure you want to change the base?
Conversation
There isn't a use-case for an immutable `buffer()` method, so the "mut" suffix is kinda unnecessary, and "next" a bit more clearly communicates that `softbuffer::Surface` potentially contains more than one buffer.
| /// Get a mutable reference to the buffer. | ||
| fn buffer_mut(&mut self) -> Result<Self::Buffer<'_>, SoftBufferError>; | ||
| fn next_buffer(&mut self) -> Result<Self::Buffer<'_>, SoftBufferError>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the doc-comment still "accurate" for the same "there is no immutable version" reason?
| } | ||
|
|
||
| /// Set the size of the buffer that will be returned by [`Surface::buffer_mut`]. | ||
| /// Set the size of the buffer that will be returned by [`Surface::next_buffer`]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| /// Set the size of the buffer that will be returned by [`Surface::next_buffer`]. | |
| /// Set the size of the buffer that will be returned by [`Surface::next_buffer()`]. |
etc
| - Added `Buffer::pixel_rows()` for iterating over rows of the buffer data. | ||
| - Added `Buffer::pixels_iter()` for iterating over each pixel with its associated `x`/`y` coordinate. | ||
| - Added `Buffer::byte_stride()` for pixel buffers whose rows are aligned and may contain padding bytes at the end. Prefer to use the above helpers instead of accessing pixel data directly. | ||
| - Renamed `Surface::buffer_mut` to `Surface::next_buffer`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - Renamed `Surface::buffer_mut` to `Surface::next_buffer`. | |
| - Renamed `Surface::buffer_mut()` to `Surface::next_buffer()`. |
There isn't a use-case for an immutable
buffer()method, so the "mut" suffix is kinda unnecessary, and "next" a bit more clearly communicates thatsoftbuffer::Surfacepotentially contains more than one buffer.