• ragingHungryPanda@lemmy.zip
    link
    fedilink
    English
    arrow-up
    11
    ·
    5 months ago

    I feel like I’ve seen an insane number of error messages in various apps and websites around the unwrap method.

    But this is on a result type, right? I’d figure the point would be that you would match on it and that the unwrap itself, which if my assumptions are correct, is more like get value or throw, should either not exist or take a default value. You shouldn’t be able to directly get the value of a monad.

    • anyhow2503@lemmy.world
      link
      fedilink
      English
      arrow-up
      5
      ·
      5 months ago

      There are good reasons to have unwrap or at least expect. There is no reason to use it in the case that Cloudflare used it in.