Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created May 25, 2020 05:56
Show Gist options
  • Save rust-play/e9a2a667c7f9015fdf681a7e6a542d63 to your computer and use it in GitHub Desktop.
Save rust-play/e9a2a667c7f9015fdf681a7e6a542d63 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
use std::collections::BTreeSet;
#[derive(Hash)]
pub enum ElemDerived {
A(ElemDerived)
}
pub enum Elem {
Derived(ElemDerived)
}
pub struct Set(BTreeSet<Elem>);
impl Set {
pub fn into_iter(self) -> impl Iterator<Item = Elem> {
self.0.into_iter()
}
}
fn main() {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment