Skip to content

dedup items in Vec<T> field #477

Answered by nklhtv
nklhtv asked this question in Q&A
Jun 14, 2022 · 2 comments · 7 replies
Discussion options

You must be logged in to vote

Hi @jonasbb You can check this commit to see my current implementation.
i want to deduplicate manifest catalogs by id & type when deserializing and serializing, while preserving the original order.
example:

{catalogs: [{"id": "top", type: "movie", ... }, {"id": "top", type: "series", ...}, {"id": "top", type: "movie", ...}] }

must be deserialized as

vec![ManifestCatalog { id: "top", r#type: "movie", ... }, ManifestCatalog { id: "top", r#type: "series", ... }]

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
7 replies
@jonasbb
Comment options

@nklhtv
Comment options

@jonasbb
Comment options

@nklhtv
Comment options

@nklhtv
Comment options

Answer selected by nklhtv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #476 on June 14, 2022 14:16.