#[derive(Debug, Clone, PartialEq, Eq)]
enum Greetable {
    Person { name: String },
    Cat { name: String },
}

impl Greetable {
    fn greet(&self) {
        match self {
            Greetable::Person { name } => println!("こんにちは！私は {} です。", name),
            Greetable::Cat { name } => println!("ニャー！私は {} よ。", name),
        }
    }
}

fn main() {
    let person = Greetable::Person { name: String::from("たろう") };
    let cat = Greetable::Cat { name: String::from("ミケ") };

    person.greet();
    cat.greet();
}
