#util

is-match

Library to check whether something matches something else

1 unstable release

0.1.0 May 3, 2017

#139 in Operating systems

Download history 5927/week @ 2020-02-06 5897/week @ 2020-02-13 5609/week @ 2020-02-20 6211/week @ 2020-02-27 6586/week @ 2020-03-05 6107/week @ 2020-03-12 8702/week @ 2020-03-19 11122/week @ 2020-03-26 10304/week @ 2020-04-02 11176/week @ 2020-04-09 12416/week @ 2020-04-16 11956/week @ 2020-04-23 12654/week @ 2020-04-30 12751/week @ 2020-05-07 11999/week @ 2020-05-14 10361/week @ 2020-05-21

32,822 downloads per month
Used in 100 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