Skip to content

Commit

Permalink
Future proof the API a little
Browse files Browse the repository at this point in the history
Don't expose Takeable in these two instances. The type is still exposed
by the Deref impls, for which we need TAIT.
  • Loading branch information
est31 committed Dec 11, 2021
1 parent 438747a commit e122ffa
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 e122ffa

Please sign in to comment.