Discussion
Loading...

Post

  • About
  • Code of conduct
  • Privacy
  • About Bonfire
Mara
@Mara@hachyderm.io  ·  activity timestamp 2 days ago

#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.

1
  • Copy link
  • Flag this post
  • Block
Mara
@Mara@hachyderm.io replied  ·  activity timestamp 2 days ago

(That the name "or_panic" would have been better isn't much of a hot take, but adding "or_panic()" now and deprecating "unwrap()" would likely be controversial.)

  • Copy link
  • Flag this comment
  • Block
Log in

bonfire of thepocolips

come over, warm up. coffee?

bonfire of thepocolips: About · Code of conduct · Privacy ·
bonfire social · 1.0.0 no JS en
Automatic federation enabled
  • Explore
  • About
  • Code of Conduct
Home
Login