#utilities #match #is-match

is-match

Library to check whether something matches something else

1 unstable release

Uses old Rust 2015

0.1.0 May 3, 2017

#2 in #utils

Download history 247/week @ 2024-12-18 93/week @ 2024-12-25 231/week @ 2025-01-01 242/week @ 2025-01-08 303/week @ 2025-01-15 168/week @ 2025-01-22 314/week @ 2025-01-29 397/week @ 2025-02-05 234/week @ 2025-02-12 188/week @ 2025-02-19 188/week @ 2025-02-26 116/week @ 2025-03-05 319/week @ 2025-03-12 232/week @ 2025-03-19 257/week @ 2025-03-26 177/week @ 2025-04-02

1,004 downloads per month
Used in 89 crates (10 directly)

MPL-2.0 license

7KB

is-match

A mini crate to check whether something matches something else:

let value = some_function_call();

if is_match!(value, Ok(Some(EnumFoo::ComplexThing { Some(_), .. })) | Ok(Some(EnumFoo::Bar(_)))) {
  /* do things */
}

License

This project was extracted from imag at commit c74c26ccd143d905c94ecf84ac423293b7170623 where only I was the author of this file. imag itself is licensed as LGPL2.1, but I'm relicensing this piece of code as MPL 2.0 here.

See LICENSE - MPL 2.0

No runtime deps