Rust map that can be defined in a const context.
There are two ways to create it:
```rust use constlookupmap::{ConstLookup, lookup};
const LOOKUP_MACRO: ConstLookup<3, &str, &str> = lookup! { "best" => "better", "test" => "testing", "guessed" => "guessing", }; ```
```rust use constlookupmap::ConstLookup;
pub const LOOKUP: ConstLookup<4, &str, &str> = ConstLookup::new( ["bye", "hallo", "hey", "test"], [ "bye.example.com", "hallo.example.com", "hey.example.com", "test.example.com", ], ); ```
One note; The keys should be in order/sorted because the get method will use this to effienctly get the value. See [ConstLookup::check_sorted
]
```rust use constlookupmap::{ConstLookup, lookup};
const LOOKUP: ConstLookup<3, &str, &str> = lookup! { "best" => "better", "test" => "testing", "guessed" => "guessing", };
fn myfunction() { asserteq!(LOOKUP.get(&"best"), Some(&"better")); assert_eq!(LOOKUP[&"best"], "better"); } ```