#utils #matches #whether #check

is-match

Library to check whether something matches something else

1 unstable release

Uses old Rust 2015

0.1.0 May 3, 2017

#10 in #matches

Download history 182/week @ 2024-10-24 254/week @ 2024-10-31 112/week @ 2024-11-07 207/week @ 2024-11-14 226/week @ 2024-11-21 330/week @ 2024-11-28 346/week @ 2024-12-05 365/week @ 2024-12-12 220/week @ 2024-12-19 107/week @ 2024-12-26 230/week @ 2025-01-02 242/week @ 2025-01-09 278/week @ 2025-01-16 146/week @ 2025-01-23 322/week @ 2025-01-30 395/week @ 2025-02-06

1,190 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