Skip to content

Use MultiMap instead of HashMap for the parsed query params #57

@havarnov

Description

@havarnov

Use multimap for the parsed query params instead of HashMap<String, Vec<String>>.

Mulitmap is basically a thin wrapper around HashMap<T, Vec<T>>, 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.:

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions