rust-syndication / rss

Library for serializing the RSS web content syndication format
https://crates.io/crates/rss
Apache License 2.0
419 stars 52 forks source link

autodetect xml namespaces used in items and extensions #107

Closed andy128k closed 3 years ago

andy128k commented 3 years ago

Closes #105

codecov[bot] commented 3 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@0d9ab48). Click here to learn what that means. The diff coverage is 92.85%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #107   +/-   ##
=========================================
  Coverage          ?   85.63%           
=========================================
  Files             ?       25           
  Lines             ?     1921           
  Branches          ?        0           
=========================================
  Hits              ?     1645           
  Misses            ?      276           
  Partials          ?        0           
Impacted Files Coverage Δ
src/extension/dublincore.rs 58.77% <75.00%> (ø)
src/extension/itunes/itunes_item_extension.rs 98.11% <75.00%> (ø)
src/item.rs 92.81% <90.90%> (ø)
src/channel.rs 89.04% <93.33%> (ø)
src/toxml.rs 100.00% <100.00%> (ø)
tests/write.rs 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0d9ab48...ec883dd. Read the comment docs.

kitlith commented 3 years ago

Yes, this seems to work for me. My one comment about this implementation, though, is that it makes writing RSS files that are purposely leaving out the namespaces impossible. I don't know that we care about that though.

If we did care about that, I'd probably let the Builder automatically add the namespaces (along with a builder method to just add a single namespace), and add a method to Channel to optionally perform autodetection.

As it is, I believe the namespaces hashmap will be empty before being written, but after reading it back in again it will have contents. (how does this interact with the verification feature?)

Is any of that actually important? That's up to you.