Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/pixmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,11 @@ impl<'a> PixmapRef<'a> {
}
}

/// Reborrows the current container
pub fn as_ref(&self) -> Self {
*self
}

/// Returns pixmap's width.
#[inline]
pub fn width(&self) -> u32 {
Expand Down Expand Up @@ -489,6 +494,14 @@ impl<'a> PixmapMut<'a> {
}
}

/// Reborrows the current container
pub fn as_mut<'b: 'a>(&'b mut self) -> PixmapMut<'b> {
Self {
data: self.data,
size: self.size,
}
}

/// Returns pixmap's width.
#[inline]
pub fn width(&self) -> u32 {
Expand Down