Skip to content

Instantly share code, notes, and snippets.

@sam0x17
Created March 21, 2023 19:02
Show Gist options
  • Save sam0x17/8b09fccfa7a457e6cd3c86ccb38e517f to your computer and use it in GitHub Desktop.
Save sam0x17/8b09fccfa7a457e6cd3c86ccb38e517f to your computer and use it in GitHub Desktop.
how to use prettyplease for syntax formatting
let formatted = prettyplease::unparse(&syn::parse_file(output.to_string().as_str()).unwrap());
// where output is a TokenStream2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment