Don’t say anyway, say anyhow

    • Korne127@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      3 days ago

      A very typical use-case would be getting something from a HashMap (or a Vector) and calling unwrap because you know it must exist (as you got a reference to the index or object that must be valid in the HashMap or Vector).
      Or if you call a function that returns Option<…> depending on the current state and you know that it must return Some(…) in the current situation.

    • marcos@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      6 days ago

      Oh, it can happen when you do calculations with compile-time constants…

      But the GP’s claim that it’s a “frequent” thing is suspect.

      (Crashing is also useful when you are writing and-user applications, but you’ll probably want .expect like in the meme.)