• soc@programming.dev
    link
    fedilink
    English
    arrow-up
    0
    ·
    14 days ago

    Thanks for your reply, some replies below!

    I can understand someone preferring the PartialEq/PartialOrd behavior

    You can have both – that’s what’s being made possible by them not being in a hierarchy.

    I think if-let makes sense, but don’t expand it.

    It’s a bit late for that, isn’t it? ;-)

    But you’re also missing one use of the impl keyword: fn func() -> impl Trait.

    That removal could actually happen, so I didn’t list it. (Rust started requiring dyn and disallowed naked trait returns with edition 2018. So dropping the impl in that position might not be completely impossible like the other uses of impl.)

    Why? What value does -> () provide? Why not elide that?

    What value is provided by keeping it? Why a syntactic special-case for exactly that type and not any other random type?

    languages w/o them feel awkward since you’re generally limited to one statement per line

    Then fixing that might make sense. :-)