Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created August 22, 2019 16:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rust-play/7d7d520e37a3dacb51eeba9c14bc6f55 to your computer and use it in GitHub Desktop.
Save rust-play/7d7d520e37a3dacb51eeba9c14bc6f55 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
use std::io::Write;
pub fn feed_type_post_body(kind: bool) -> for<'w> fn(into: &'w mut dyn Write) -> Box<dyn Write + 'w> {
match kind {
true => feed_rss_post_body,
false => feed_rss_post_body,
}
}
pub fn feed_rss_post_body<'w>(into: &'w mut dyn Write) -> Box<dyn Write + 'w> {
Box::new(into)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment