diff options
| author | Fuwn <[email protected]> | 2023-04-06 08:34:24 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-04-06 08:34:24 +0000 |
| commit | 873cef6fbba01c99733c97378b5f001779604cf4 (patch) | |
| tree | 4dc531b2005740ec5048350ecdae7ba15836e058 /src/utilities.rs | |
| parent | feat(cargo): bump 0.3.1 -> 0.3.2 (diff) | |
| download | windmark-873cef6fbba01c99733c97378b5f001779604cf4.tar.xz windmark-873cef6fbba01c99733c97378b5f001779604cf4.zip | |
fix(context): custom parameters format for easy lifetimes
Diffstat (limited to 'src/utilities.rs')
| -rw-r--r-- | src/utilities.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/utilities.rs b/src/utilities.rs index 68962ff..aa14292 100644 --- a/src/utilities.rs +++ b/src/utilities.rs @@ -31,3 +31,13 @@ pub fn queries_from_url(url: &url::Url) -> HashMap<String, String> { queries } + +#[must_use] +pub fn params_to_hashmap( + params: &matchit::Params<'_, '_>, +) -> HashMap<String, String> { + params + .iter() + .map(|(k, v)| (k.to_string(), v.to_string())) + .collect() +} |