Crates.io | check-ends-macro |
lib.rs | check-ends-macro |
version | 1.0.3 |
source | src |
created_at | 2021-10-01 12:01:40.054011 |
updated_at | 2021-10-03 16:42:33.533439 |
description | A couple of macros to simulate match with starts and ends of a string. |
homepage | |
repository | https://github.com/DumbMahreeo/check-ends-macro |
max_upload_size | |
id | 459103 |
size | 3,539 |
It's like a match, but it returns an Option
let to_match = "hello world";
let opt = match_start! {to_match,
"hello" | "something" => "something else"
"world" | "another" => "another thing"
};
if let Some(value) = opt {
println!("{}", value); // Will print "something else"
}