Created
July 1, 2019 08:47
-
-
Save aisrael/057b82479f1896ef34a5e2b2b2f786c0 to your computer and use it in GitHub Desktop.
This shouldn't work according to the docs
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 Context<'s>(&'s str); | |
struct Parser<'c, 's> { | |
context: &'c Context<'s>, | |
} | |
impl<'c, 's> Parser<'c, 's> { | |
fn parse(&self) -> Result<(), &'s str> { | |
Err(&self.context.0[1..]) | |
} | |
} | |
pub fn parse_context(context: Context) -> Result<(), &str> { | |
Parser { context: &context }.parse() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment