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

Add mnc/mcc fields to Carrier #59

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Add mnc/mcc fields to Carrier #59

wants to merge 5 commits into from

Conversation

gferon
Copy link
Contributor

@gferon gferon commented Sep 4, 2023

Will be used in whisperfish/libsignal-service-rs#241 instead of having this in libsignal-service-rs.

@gferon gferon requested a review from rubdos September 4, 2023 07:05
@rubdos
Copy link
Member

rubdos commented Sep 4, 2023

Should we be bumping versions in merge requests? Is it not more logical to bump them independently? I'm not very good with version management myself though.

Comment on lines +22 to 25
pub struct Carrier {
pub mcc: u16, // always 3 digits
pub mnc: u16, // 2 or 3 digits
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this one of the rare occasions where we should prefer getters to fields? We might change the representation over time, e.g. by compressing mcc and mnc in a single u16.

Additionally, MNC 001 is not the same as MNC 01, so I'm not sure this representation is the safest.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point, I guess we could make it &str depending on the lifetime of PhoneNumber. I'll rework the PR ASAP.

Copy link

codecov bot commented Dec 14, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (1f46da5) 71.81% compared to head (4b07e85) 72.16%.
Report is 3 commits behind head on main.

Files Patch % Lines
src/carrier.rs 88.23% 2 Missing ⚠️
src/formatter.rs 60.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #59      +/-   ##
==========================================
+ Coverage   71.81%   72.16%   +0.35%     
==========================================
  Files          19       19              
  Lines        1955     1969      +14     
==========================================
+ Hits         1404     1421      +17     
+ Misses        551      548       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rubdos
Copy link
Member

rubdos commented Jul 7, 2024

@gferon any chance you could have a look at this some time soon? Otherwise I might take this up.

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.

2 participants