> ## Documentation Index
> Fetch the complete documentation index at: https://loadwise.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# rust-unwrap-in-production

> Rust code outside tests calls unwrap(), turning an Err or None into a panic.

## What it flags

`.unwrap()` in non-test code panics on `None` or `Err`.

## How to review or fix

Test modules, `static`/`const` items and lock guards are accepted. Handle the case or use `expect` with the invariant that makes it safe.

## Configuration

Set the rule to `"off"` in `loadwise.config.json` to drop its findings:

```json theme={null}
{
  "rules": { "rust-unwrap-in-production": "off" }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.