Last active
July 11, 2016 03:24
-
-
Save stusmall/afcf31b1cb9bf3c8989f6ba4c1a3c813 to your computer and use it in GitHub Desktop.
This file contains 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
pub struct OutsideStruct<'a> { | |
data: InsideStruct<'a> | |
} | |
pub struct InsideStruct<'a> { | |
data: &'a[u8] | |
} | |
impl <'a>OutsideStruct<'a> { | |
pub fn new<'b>(data:&'b[u8]) -> OutsideStruct<'b>{ | |
OutsideStruct{ | |
data: InsideStruct::new(data) | |
} | |
} | |
} | |
impl <'a>InsideStruct<'a> { | |
pub fn new<'b>(data:&'b[u8]) -> InsideStruct{ | |
InsideStruct{ | |
data: data.clone() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment