Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm not sure I'm following. Rust allows:

    println!("{}", if x == None { "foo" } else { "bar" });
How would unions make this more ergonomic? For example, in Python (with type annotations), you would have to do:

    print("foo" if x == None else "bar")


Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: