elixir-webrtc / ex_webrtc

An Elixir implementation of the W3C WebRTC API
Apache License 2.0
270 stars 8 forks source link

Convert PeerConnection internal state into map #24

Closed mickel8 closed 7 months ago

mickel8 commented 7 months ago

The benefit of Structs over maps is that we have compile time checks so e.g. if we do state.non_existing_field we will be warned by the compiler about this fact.

If we want to keep structs for internal states, we should also convert DTLSTransport state into struct.

Any thoughts?

Personally, I would move to maps :stuck_out_tongue:

codecov[bot] commented 7 months ago

Codecov Report

Merging #24 (b59bd8a) into verify-fingerprint (885f861) will increase coverage by 0.17%. The diff coverage is 100.00%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## verify-fingerprint #24 +/- ## ====================================================== + Coverage 83.88% 84.05% +0.17% ====================================================== Files 10 10 Lines 484 483 -1 ====================================================== Hits 406 406 + Misses 78 77 -1 ``` | [Files](https://app.codecov.io/gh/elixir-webrtc/ex_webrtc/pull/24?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=elixir-webrtc) | Coverage Δ | | |---|---|---| | [lib/ex\_webrtc/peer\_connection.ex](https://app.codecov.io/gh/elixir-webrtc/ex_webrtc/pull/24?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=elixir-webrtc#diff-bGliL2V4X3dlYnJ0Yy9wZWVyX2Nvbm5lY3Rpb24uZXg=) | `79.78% <100.00%> (+0.42%)` | :arrow_up: | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/elixir-webrtc/ex_webrtc/pull/24?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=elixir-webrtc). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=elixir-webrtc) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/elixir-webrtc/ex_webrtc/pull/24?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=elixir-webrtc). Last update [885f861...b59bd8a](https://app.codecov.io/gh/elixir-webrtc/ex_webrtc/pull/24?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=elixir-webrtc). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=elixir-webrtc).