Merge pull request #6 from kpreid/asref
Add `impl AsRef<W> for GraphicsContext<W>`.
This commit is contained in:
commit
745c2d44dc
1 changed files with 8 additions and 0 deletions
|
|
@ -122,6 +122,14 @@ impl<W: HasRawWindowHandle> GraphicsContext<W> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<W: HasRawWindowHandle> AsRef<W> for GraphicsContext<W> {
|
||||
/// Equivalent to [`self.window()`](Self::window()).
|
||||
#[inline]
|
||||
fn as_ref(&self) -> &W {
|
||||
self.window()
|
||||
}
|
||||
}
|
||||
|
||||
trait GraphicsContextImpl {
|
||||
unsafe fn set_buffer(&mut self, buffer: &[u32], width: u16, height: u16);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue