Instantly share code, notes, and snippets.

Embed
What would you like to do?
struct Node {
id: i32,
}
struct Edge<'a> {
from: &'a Node,
to: &'a Node,
}
pub fn main() {
let x = Node { id: 1 };
let y = Node { id: 2 };
{
let e = Edge { from: &x, to: &y };
let f = Edge { from: &y, to: &x };
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment