Skip to content
This repository was archived by the owner on Oct 19, 2024. It is now read-only.
This repository was archived by the owner on Oct 19, 2024. It is now read-only.

Use HashMap::from for immediate-use hashmaps initialization #511

Closed
@shekhirin

Description

@shekhirin

Is your feature request related to a problem? Please describe.
Currently, to initialize a HashMap that's intended to be used immediately with some values, we do

let mut map = HashMap::new();
map.insert("guid", guid.as_ref());
let body = self.create_query("contract", "checkverifystatus", map);

Rust 1.56.0 introduces a new way to do so:

let body = self.create_query("contract", "checkverifystatus", HashMap::from([
    ("guid", guid.as_ref()),
]));

thanks to const generics. Release with that feature is planned to be on 2021-10-21.

Describe the solution you'd like
Replace existing hashmap initializations with proposed solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions