Will It Vibe logoWill It Vibe?
RUST-004Low severity-4 points

Parse result unwrapped/expected directly

Part of Code Quality & Syntax, which counts for 20% of the overall score. When this check fires it deducts 4 points from that category, once per scan, no matter how many places it turns up.

What it detects

A `.parse()` result is unwrapped or expected directly, so a malformed input panics the whole process instead of returning an error. Heuristic: this also matches a parse of a value that happens to be a hardcoded, always-valid literal.

Why it matters

A parse().unwrap() panics the moment the input is not in the expected format, and parsed values very often come from user input, config files, or environment variables, none of which are guaranteed to be well-formed. In a server or CLI, that panic can take down a whole request or the whole process for what should be a recoverable, reportable error. It is an easy pattern to reach for during a quick prototype that then never gets revisited before shipping.

How to fix it

Replace unwrap()/expect() with proper error handling: propagate the error with the ? operator in a function that returns Result, match on the Result and return a clear error message, or fall back to a sensible default with unwrap_or/unwrap_or_default when a default is actually correct. Reserve expect() with a specific, true message for values you can prove are always valid, such as parsing a hardcoded literal.

The paid report includes a ready-to-paste prompt for your AI coding agent for every check it finds, pointed at the exact findings from your scan. See pricing

Does your repo trip this check?

Paste a GitHub URL or drop a project folder. Scans run in your browser and take seconds.

Scan your repo

Related Code Quality & Syntax checks