#check #utils #matches #whether

is-match

Library to check whether something matches something else

1 unstable release

Uses old Rust 2015

0.1.0 May 3, 2017

#9 in #matches

Download history 236/week @ 2024-07-22 299/week @ 2024-07-29 316/week @ 2024-08-05 262/week @ 2024-08-12 207/week @ 2024-08-19 393/week @ 2024-08-26 270/week @ 2024-09-02 277/week @ 2024-09-09 219/week @ 2024-09-16 323/week @ 2024-09-23 240/week @ 2024-09-30 87/week @ 2024-10-07 238/week @ 2024-10-14 219/week @ 2024-10-21 176/week @ 2024-10-28 239/week @ 2024-11-04

881 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