#rustlang hot take: We should rename .unwrap() to .or_panic(). (And .expect() to .or_panic_with().) "Unwrap" is a terrible name for the panicking function, especially since we also have things like .unwrap_or() and .unwrap_or_default() which never panic.

@Mara I'd even be in favor of .or_abort(), having panic=abort a build configuration and not an API is a misfeature imo (of course .or_panic() could stay as well)

@cehteh @Mara panic=abort should be specified by each crate and a panic=abort crate should not compile as a dependency of a non-(panic=abort) target

Follow

@zwarich @cehteh @Mara It was before I started bookmarking anything I thought I might want to refer back to but, unless my memory is faulty, "panic mode is a property of the top-level project (as defined by the binary crate), not individual crates" was an intentional design decision for the sake of encouraging composability, similar to how not allowing type inference in function signatures is an intentional restriction, not a technical limitation.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.