use std::hash::{Hash, Hasher};

#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Default)]
struct User {
    name: String,
    email: String,
    gender: char,
    birth: u16,
    is_active: bool,
    last_login: Option<String>,
}

fn main() {
    let alice = User {
        name: String::from("Alice"),
        email: String::from("alice@example.com"),
        gender: 'F',
        birth: 1990,
        is_active: true,
        last_login: Some(String::from("2023-01-01")),
    };
    let bob = User {
        name: String::from("Bob"),
        email: String::from("bob@example.com"),
        gender: 'M',
        birth: 1985,
        is_active: false,
        last_login: None,
    };
    println!("{:?}", alice);
    println!("{}", alice == bob);
    println!("{}", alice > bob);
    let candy = alice.clone();
    let mut state = std::collections::hash_map::DefaultHasher::new();
    candy.hash(&mut state);
    println!("{}", state.finish());
    let anonymous = User::default();
    println!("{:?}", anonymous);
}