Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created April 27, 2018 19:01
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/c46c6773968540c25d66d57ff1420b28 to your computer and use it in GitHub Desktop.
Save rust-play/c46c6773968540c25d66d57ff1420b28 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
#[derive(Copy, Clone)]
pub enum Edit<'a, T: 'a + Eq> {
Foo(&'a T),
}
struct GridEntry<'a, T: 'a + Eq> {
edit: Edit<'a, T>
}
impl<'a, T: 'a + Eq> GridEntry<'a, T> {
fn f(&self) {
let _e: Edit<'a, T> = self.edit;
}
}
fn main() {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment