Registry / utility / matches

matches

JSON →
library0.1.10rscratesunverified

A macro to evaluate, as a boolean, whether an expression matches a pattern.

# Cargo.toml [dependencies] matches = "0.1.10"
INSTALL
IMPORT
SIG · MATCHES
M
matches
utilityrustv0.1.10
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

matches
use matches::matches;

Use the matches! macro to test if a value matches a pattern.

use matches::matches; fn main() { let x = 42; if matches!(x, 40..=50) { println!("x is between 40 and 50"); } }
Debug
Known issues
gotchaThis macro is now available in Rust std since 1.42.0; consider using std::matches! instead.
fix
Replace with std::matches! and remove the dependency.
affects: >=1.42.0
Upgrade
Version history
0.1.10latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Amazon
1
Resources
matches — cargo add matches · libregistry