Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library
← Back to context

Comment by rainbow-road

5 years ago

Yep. I'm pretty sure that even with unsafe shenanigans, you can't access the value without being very explicit about it. You'd need something like:

    let value = unsafe {
        match result {
            Ok(value) => value,
            _ => hint::unreachable_unchecked()
        }
    };

At this point, the fact that you've skipped an error check should be abundantly clear to anyone reading your code.

0 comments

rainbow-road

Reply

No comments yet

Contribute on Hacker News ↗

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities