Created
February 15, 2013 18:57
-
-
Save jbclements/4962504 to your computer and use it in GitHub Desktop.
How to make the borrow live long enough?
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
pub struct AStruct { | |
x : uint | |
} | |
pub enum HasAStruct { | |
A(~AStruct) | |
} | |
pub fn getAStruct(a: </HasAStruct) -> </AStruct { | |
match *a { | |
A (s) => &(*s), | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment