enum List<T> {
    Cons(T, Box<List<T>>),
    Nil,
}

fn main() {
    let list: List<i32> = List::Cons(1, Box::new(List::Cons(2, Box::new(List::Nil))));
    match list {
        List::Nil => println!("Nil"),
        List::Cons(x, y) => println!("{}", x)
    };
    match list {
        List::Nil => println!("Nil"),
        List::Cons(x, y) => println!("{}", x)
    };
}