Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Future proof the API a little #1974

Merged
merged 1 commit into from Dec 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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