Skip to content

Instantly share code, notes, and snippets.

@QuietMisdreavus
Created August 3, 2018 20:50
Show Gist options
  • Save QuietMisdreavus/f4aba35c3e227f55abb6d2d47e2dc8c6 to your computer and use it in GitHub Desktop.
Save QuietMisdreavus/f4aba35c3e227f55abb6d2d47e2dc8c6 to your computer and use it in GitHub Desktop.
use std::ops::Deref;
pub struct Base;
impl Base {
pub fn asdf(&self) {}
}
pub struct LevelOne {
pub base: Base,
}
impl Deref for LevelOne {
type Target = Base;
fn deref(&self) -> &Base {
&self.base
}
}
impl LevelOne {
pub fn qwop(&self) {}
}
pub struct LevelTwo {
pub base: LevelOne,
}
impl Deref for LevelTwo {
type Target = LevelOne;
fn deref(&self) -> &LevelOne {
&self.base
}
}
impl LevelTwo {
pub fn custom() {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment