iron / iron/urlencoded

Use MultiMap instead of HashMap for the parsed query params

Open
#57 9 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
23
Forks
28
PR merge metrics
No merged PRs in 30d

Description

Use [multimap](https://github.com/havarnov/multimap) for the parsed query params instead of `HashMap>`.

Mulitmap is basically a thin wrapper around `HashMap>`, but with (imo) a bit better api for using the values. Especially for the common use case of only having one value per key. E.g.:

``` rust
let params: HashMap> = HashMap::new();
let val = params["key"][0];
for (key, vec_of_val) in params {...}

let params: MultiMap = MultiMap::new();
let val = params["key"];
for (key, val) in params.iter() {...}
for (key, vec_of_val) in params.iter_all() {...}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.