Skip to content

Commit

Permalink
Relax lifetime restrictions on as_raw_buffer, `as_raw_nopadding_buf…
Browse files Browse the repository at this point in the history
…fer`, and `save_as_image<T` for `windows_capture::frame::FrameBuffer`
  • Loading branch information
winestone committed Apr 28, 2024
1 parent 1c06e69 commit 1f43f6f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ impl<'a> FrameBuffer<'a> {

/// Get the raw pixel data with possible padding.
#[must_use]
pub fn as_raw_buffer(&'a mut self) -> &'a mut [u8] {
pub fn as_raw_buffer(&mut self) -> &mut [u8] {
self.raw_buffer
}

Expand All @@ -454,7 +454,7 @@ impl<'a> FrameBuffer<'a> {
/// # Returns
///
/// A mutable reference to the buffer containing pixel data without padding.
pub fn as_raw_nopadding_buffer(&'a mut self) -> Result<&'a mut [u8], Error> {
pub fn as_raw_nopadding_buffer(&mut self) -> Result<&mut [u8], Error> {
if !self.has_padding() {
return Ok(self.raw_buffer);
}
Expand Down Expand Up @@ -493,7 +493,7 @@ impl<'a> FrameBuffer<'a> {
///
/// An `Ok` result if the image is successfully saved, or an `Err` result if there was an error.
pub fn save_as_image<T: AsRef<Path>>(
&'a mut self,
&mut self,
path: T,
format: ImageFormat,
) -> Result<(), Error> {
Expand Down

0 comments on commit 1f43f6f

Please sign in to comment.