Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created April 20, 2019 04:08
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/a8796d556b5b40a3a11a361b51b97c4a to your computer and use it in GitHub Desktop.
Save rust-play/a8796d556b5b40a3a11a361b51b97c4a to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
fn foo(iter: impl Iterator) -> impl Iterator {
if 0 == 0 {
iter.map(|x| x)
} else {
iter.filter(|x| true)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment