Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DASH_WASM: Update quick-xml (Rust) dependency and consequently update Rust code #1267

Merged
merged 1 commit into from
Aug 22, 2023

Conversation

peaBerberian
Copy link
Collaborator

This commit updates the dependency in our Rust code, quick-xml, which allows to parse XML documents (which DASH MPD are) in our WASM MPD parser in a SAX-like manner.

The major change here is that the types for element names and attributes is now implemented by single-field structs whose field is the reference to the corresponding name whereas it was directly the reference initially.

Thankfully, there's no need to bring that new struct's name in all our pattern-matching cases (which would have been less readable), as calling the as_ref method implemented on that struct returns directly the reference we had before (we can thus pattern match on this instead, and keep the previous code for all matched patterns).
This is actually what is presented in quick-xml examples so it also seems like the idiomatic way to do it.

However the major part of that code is a formatting update, done thanks to the rust-official rustfmt tool and code updates based on clippy (official Rust linter) lints.

This branch was tested with success on various DASH contents.

… Rust code

This commit updates the dependency in our Rust code, `quick-xml`, which
allows to parse XML documents (which DASH MPD are) in our WASM MPD
parser in a SAX-like manner.

The major change here is that the types for element names and attributes
is now implemented by single-field structs whose field is the reference
to the corresponding name whereas it was directly the reference initially.

Thankfully, there's no need to bring that new struct's name in all our
pattern-matching cases (which would have been less readable), as calling
the `as_ref` method implemented on that struct returns directly the
reference we had before (we can thus pattern match on this instead, and
keep the previous code for all matched patterns).
This is actually what is presented in quick-xml examples so it also seems
like the idiomatic way to do it.

However the major part of that code is a formatting update, done thanks
to the rust-official `rustfmt` tool and code updates based on clippy
(official Rust linter) lints.

This branch was tested with success on various DASH contents.
@peaBerberian peaBerberian added this to the 3.31.1 milestone Aug 4, 2023
@peaBerberian peaBerberian merged commit a61c922 into master Aug 22, 2023
3 checks passed
@peaBerberian peaBerberian deleted the misc/wasm-quick-xml-update branch August 22, 2023 14:39
@peaBerberian peaBerberian modified the milestones: 3.31.1, 3.32.0 Sep 12, 2023
@peaBerberian peaBerberian mentioned this pull request Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant