#util

is-match

Library to check whether something matches something else

1 unstable release

0.1.0 May 3, 2017

#18 in Windows APIs

Download history 6537/week @ 2018-11-15 6201/week @ 2018-11-22 7408/week @ 2018-11-29 7361/week @ 2018-12-06 7046/week @ 2018-12-13 6067/week @ 2018-12-20 5721/week @ 2018-12-27 6261/week @ 2019-01-03 6051/week @ 2019-01-10 6196/week @ 2019-01-17 6109/week @ 2019-01-24 6855/week @ 2019-01-31 8884/week @ 2019-02-07 6875/week @ 2019-02-14 7298/week @ 2019-02-21

22,684 downloads per month
Used in 69 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