nik-rev

nik-rev / evil

Public

This rust crate allows using the ? operator as a shorthand for .unwrap()

13
1
100% credibility
Found Mar 04, 2026 at 13 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
Rust
AI Summary

This Rust crate provides a custom result type that allows the ? operator to unwrap values from Results and Options by panicking on failure, mainly for simplifying tests and developer scripts.

How It Works

1
😩 Frustrated with wordy checks

You're writing tests for your program, but handling possible failures makes the code too long and distracting.

2
🔍 Discover a clever shortcut

You hear about a fun tool called 'evil' that lets you write much shorter tests by assuming things work.

3
Add the magic helper

You easily include this special helper into your project to simplify your test writing.

4
✏️ Rewrite tests simply

Now you use quick symbols in your tests to skip the long failure checks, and it shows exactly where issues happen.

5
🧪 Run your tests

You launch the tests, and they run smoothly or point right to the problem spot if something fails.

🎉 Focus on what matters

Your tests are now clean and short, letting you concentrate on checking your program's real behavior without extra hassle.

Sign up to see the full architecture

4 more

Sign Up Free

Star Growth

See how this repo grew from 13 to 13 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is evil?

Evil is a Rust crate that redefines the `?` operator to behave like `.unwrap()`, letting you chain it seamlessly on both `Result`s and `Option`s without boilerplate. It solves the pain of verbose error handling in tests and quick scripts, where panics on failure keep focus on logic rather than `unwrap()` spam. Return `evil::Result<()>` from your test functions or main, and watch errors explode with exact file/line details for fast debugging.

Why is it gaining traction?

Unlike eyre or anyhow, which force awkward `.ok_or()` hacks on `Option`s, evil handles both types natively with precise panic traces—no lost context on failure. Amid GitHub's sea of "evil" projects like evil emacs, evil helix, evil pdf, or even resident evil github repos, this stands out for rust crate features that streamline tests without stable Rust compromises. The hook? Nightly-only for dev speed, but your lib stays stable—perfect for CI with cargo hack.

Who should use this?

Rust test writers drowning in JSON parsing or API mock chains, like verifying user prefs in integration tests. Script hackers prototyping CLIs or data pipelines that evolve into apps, avoiding future anyhow refactors. Teams using nightly rustfmt for cleaner merges, but shipping stable MSRV.

Verdict

Grab it for test suites if you're on nightly—13 stars and 1.0% credibility scream early alpha, with thin docs and no broad adoption yet. Solid for personal DX, but skip for prod code until it matures.

(178 words)

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.