-
-
Save QuietMisdreavus/f4aba35c3e227f55abb6d2d47e2dc8c6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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