Created
June 28, 2025 21:17
-
-
Save freedomtowin/99af0ba17d00bf5a45723c7c006a8f45 to your computer and use it in GitHub Desktop.
Example of creating a Gist using Python
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
struct Condition(Expr); | |
impl Parse for Condition { | |
fn parse(input: ParseStream) -> syn::Result<Self> { | |
_ = input.parse::<Token![if]>()?; | |
input.parse().map(Self) | |
} | |
} | |
impl ToTokens for Condition { | |
fn to_tokens(&self, tokens: &mut TokenStream2) { | |
self.0.to_tokens(tokens) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment