diff --git a/src/pixmap.rs b/src/pixmap.rs index b49f5a0..82e76fb 100644 --- a/src/pixmap.rs +++ b/src/pixmap.rs @@ -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 { @@ -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 {