whisperfish / rust-phonenumber

Library for parsing, formatting and validating international phone numbers.
Apache License 2.0
156 stars 55 forks source link

Once cell instead of lazy_static #66

Closed rubdos closed 2 months ago

rubdos commented 9 months ago

(Currently based on #65)

Follow-up from #60.

codecov[bot] commented 9 months ago

Codecov Report

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

Comparison is base (226b6fb) 71.39% compared to head (3e25e31) 70.90%.

Files Patch % Lines
src/consts.rs 55.97% 70 Missing :warning:
src/carrier.rs 0.00% 1 Missing :warning:
src/error.rs 0.00% 1 Missing :warning:
src/extension.rs 0.00% 1 Missing :warning:
src/phone_number.rs 50.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #66 +/- ## ========================================== - Coverage 71.39% 70.90% -0.50% ========================================== Files 19 20 +1 Lines 1930 2021 +91 ========================================== + Hits 1378 1433 +55 - Misses 552 588 +36 ```

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

rubdos commented 9 months ago
     Parsing phonenumber v0.3.3+8.13.9 (current)
     Parsing phonenumber v0.3.3+8.13.9 (baseline, cached)
    Removing stale cached baseline rustdoc for phonenumber
     Parsing phonenumber v0.3.3+8.13.9 (baseline)
    Checking phonenumber v0.3.3+8.13.9 -> v0.3.3+8.13.9 (no change)
   Completed [   0.080s] 48 checks; 47 passed, 1 failed, 0 unnecessary

--- failure struct_missing: pub struct removed or renamed ---

Description:
A publicly-visible struct cannot be imported by its prior path. A `pub use` may have been removed, or the struct itself may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.23.0/src/lints/struct_missing.ron

Failed in:
  struct phonenumber::metadata::DATABASE, previously in file /home/rsmet/.cargo/registry/src/index.crates.io-6f17d22bba15001f/phonenumber-0.3.3+8.13.9/src/metadata/database.rs:32
       Final [   0.080s] semver requires new major version: 1 major and 0 minor checks failed
rubdos commented 9 months ago

DEFAULT is exposed as a lazy_static! in currently released versions, and putting it behind Lazy technically breaks the type. Since #63 is upcoming too, I think those efforts should probably be joined either way.

gferon commented 9 months ago

@rubdos I guess you should add a merge commit from the main branch?

rubdos commented 9 months ago

@rubdos I guess you should add a merge commit from the main branch?

I should rebase indeed. But since this breaks the API/semver, we'll do that after we release 0.3.4 :-)

rubdos commented 2 months ago

@gferon, this too was 0.4-material because it breaks public API. I'll foresee a 0.3 branch for whatever I still want backported.