Re:Rust should not have provided `unwrap`
by caylus on Friday July 15, 2022 @01:15PM
(#32110464)
> Well, that puts regex compilation in the same category as array indexing in my mind, and means that the default regex compilation function should panic on the user’s behalf
I like the Go stdlib idiom for this: many functions have a version with a "Must" prefix that has the behavior of panicking rather than returning an error.
I like the Go stdlib idiom for this: many functions have a version with a "Must" prefix that has the behavior of panicking rather than returning an error.
e.g. for regexp: https://pkg.go.dev/regexp#MustCompile