magic-wormhole / magic-wormhole.rs

Rust implementation of Magic Wormhole, with new features and enhancements
European Union Public License 1.2
722 stars 78 forks source link

core: Access struct fields via accessor methods #232

Closed felinira closed 1 month ago

felinira commented 2 months ago

These struct fields were public, and therefore modifiable if you have a mutable reference to them. However their purpose is to expose connection state for apps to consume, not to be changeable during the connection, which could lead to strange behaviour, or be at the very least confusing.

This makes them private and exposes them via getters.

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 19.04762% with 17 lines in your changes missing coverage. Please review.

Project coverage is 38.13%. Comparing base (00c3ef9) to head (9b99548).

Files Patch % Lines
src/core.rs 16.66% 10 Missing :warning:
cli/src/main.rs 0.00% 5 Missing :warning:
src/forwarding.rs 0.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #232 +/- ## ========================================== + Coverage 37.77% 38.13% +0.35% ========================================== Files 17 17 Lines 3142 3152 +10 ========================================== + Hits 1187 1202 +15 + Misses 1955 1950 -5 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.