Skip to content

Implement HashMap support the same way as Vec (PR #1070) #1071

Open
@rimutaka

Description

@rimutaka

I have a struct where some members are Vec and some are HashSet. They both should convert to/from a GraphQL list.

pub struct Keywords {
    pub full_list: Vec<String>,
    pub unique_list: HashSet<String>,
}

There is a built-in support for Vec, but not for HashSet. I would think that adding HashSet support would make life easier in cases like this.

I copied the impl code for Vec to enable HashMap support in PR #1070. So far it worked fine.

  1. Is there a reason not to do it?
  2. Is there a better way of doing it?

If the idea is sound, would you consider that PR?
I will need to add input support, tests and see if docs need updating before it is ready. Just wanted to check with the maintainers (@tyranron , @ilslv, @LegNeato ?) if I'm on the right track here.

Metadata

Metadata

Assignees

Labels

enhancementImprovement of existing features or bugfix

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions