Skip to content

Commit

Permalink
Merge pull request #1974 from est31/master
Browse files Browse the repository at this point in the history
Future proof the API a little
  • Loading branch information
est31 committed Dec 11, 2021
2 parents 438747a + e122ffa commit 455b1e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/backend/glutin/headless.rs
Expand Up @@ -30,7 +30,7 @@ impl Deref for Headless {

impl Deref for GlutinBackend {
type Target = Rc<RefCell<Takeable<glutin::Context<Pc>>>>;
fn deref(&self) -> &Rc<RefCell<Takeable<glutin::Context<Pc>>>> {
fn deref(&self) -> &Self::Target {
&self.0
}
}
Expand Down Expand Up @@ -121,7 +121,7 @@ impl Headless {
}

/// Borrow the inner glutin context
pub fn gl_context(&self) -> Ref<'_, Takeable<glutin::Context<Pc>>> {
pub fn gl_context(&self) -> Ref<'_, impl Deref<Target = glutin::Context<Pc>>> {
self.glutin.borrow()
}

Expand Down
4 changes: 2 additions & 2 deletions src/backend/glutin/mod.rs
Expand Up @@ -162,7 +162,7 @@ impl Display {

/// Borrow the inner glutin WindowedContext.
#[inline]
pub fn gl_window(&self) -> Ref<'_, Takeable<glutin::WindowedContext<Pc>>> {
pub fn gl_window(&self) -> Ref<'_, impl Deref<Target = glutin::WindowedContext<Pc>>> {
self.gl_window.borrow()
}

Expand Down Expand Up @@ -240,7 +240,7 @@ impl backend::Facade for Display {
impl Deref for GlutinBackend {
type Target = Rc<RefCell<Takeable<glutin::WindowedContext<Pc>>>>;
#[inline]
fn deref(&self) -> &Rc<RefCell<Takeable<glutin::WindowedContext<Pc>>>> {
fn deref(&self) -> &Self::Target {
&self.0
}
}
Expand Down

0 comments on commit 455b1e4

Please sign in to comment.