Skip to content

Feat: Make HashSet usable in doc! macro #583

@TheDan64

Description

@TheDan64

Many times I'll deduplicate i64s into a set, HashSet and I want to do:

let filter = doc! {
    "my_id": {
        "$in": id_set,
    }
};

but this doesn't work, and I have to re-collect the HashSet into a Vec. It would be nice if you could use HashSet<T> or HashSet<&T> where T is a bsonable type that normally works in Vec<T> to not have to reallocate since you're probably converting it to your own internal type anyway?

Metadata

Metadata

Assignees

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