Created
February 9, 2018 15:56
-
-
Save prepor/2ebdf7aebc52c01aaa7d4bbec065c5cc 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
| enum Bar { | |
| One(String), | |
| Two(String) | |
| } | |
| struct Foo { | |
| bars: Vec<Bar> | |
| } | |
| impl Foo { | |
| fn x(&mut self) { | |
| match self.bars[0] { | |
| Bar::One(ref c) => self.y(), | |
| Bar::Two(_) => self.y() | |
| } | |
| } | |
| fn y(&mut self) { | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment