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

Make once_cell dependency optional #444

Merged
merged 1 commit into from
Jul 14, 2024
Merged

Conversation

tatsuya6502
Copy link
Member

Fixes #427.

This pull request changes once_cell crate optional. After applying this change, once_cell is used by moka only when the followings:

  • development build (e.g. cargo test).
  • unstable-debug-counters feature is enabled.
## `once_cell` is used in [dev-dependency], and indirectly via `quanta`.

$ cargo tree -i once_cell -F future,sync
once_cell v1.19.0
├── ahash v0.8.11
│   [dev-dependencies]
│   └── moka v0.12.8 ( ... /moka)
├── async-global-executor v2.4.1
│   └── async-std v1.12.0
│       [dev-dependencies]
│       └── moka v0.12.8 ( ... /moka)
├── async-std v1.12.0 (*)
├── quanta v0.12.3
│   └── moka v0.12.8 ( ... /moka)
├── reqwest v0.11.27
│   [dev-dependencies]
│   └── moka v0.12.8 ( ... /moka)
└── tracing-core v0.1.32
    └── tracing v0.1.40
        ├── async-io v2.3.3
        │   └── async-global-executor v2.4.1 (*)
        ├── h2 v0.3.26
        │   ├── hyper v0.14.30
        │   │   ├── hyper-rustls v0.24.2
        │   │   │   └── reqwest v0.11.27 (*)
        │   │   └── reqwest v0.11.27 (*)
        │   └── reqwest v0.11.27 (*)
        ├── hyper v0.14.30 (*)
        └── polling v3.7.2
            └── async-io v2.3.3 (*)
[dev-dependencies]
└── moka v0.12.8 ( ... /moka)

## If the default features is disabled, `once_cell` appears only under [dev-dependency].

cargo tree -i once_cell --no-default-features -F future,sync
once_cell v1.19.0
├── ahash v0.8.11
│   [dev-dependencies]
│   └── moka v0.12.8 ( ... /moka)
├── async-global-executor v2.4.1
│   └── async-std v1.12.0
│       [dev-dependencies]
│       └── moka v0.12.8 ( ... /moka)
├── async-std v1.12.0 (*)
├── reqwest v0.11.27
│   [dev-dependencies]
│   └── moka v0.12.8 ( ... /moka)
└── tracing-core v0.1.32
    └── tracing v0.1.40
        ├── async-io v2.3.3
        │   └── async-global-executor v2.4.1 (*)
        ├── h2 v0.3.26
        │   ├── hyper v0.14.30
        │   │   ├── hyper-rustls v0.24.2
        │   │   │   └── reqwest v0.11.27 (*)
        │   │   └── reqwest v0.11.27 (*)
        │   └── reqwest v0.11.27 (*)
        ├── hyper v0.14.30 (*)
        └── polling v3.7.2
            └── async-io v2.3.3 (*)
[dev-dependencies]
└── moka v0.12.8 ( ... /moka)

It will be used only when the followings:
- development build (e.g. `cargo test`).
- `unstable-debug-counters` feature is enabled.
@tatsuya6502 tatsuya6502 added this to the v0.12.9 milestone Jul 14, 2024
Copy link

codecov bot commented Jul 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.04%. Comparing base (1636ed9) to head (19abacf).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #444      +/-   ##
==========================================
+ Coverage   95.00%   95.04%   +0.03%     
==========================================
  Files          44       44              
  Lines       20979    20979              
==========================================
+ Hits        19932    19939       +7     
+ Misses       1047     1040       -7     

Copy link
Member Author

@tatsuya6502 tatsuya6502 left a comment

Choose a reason for hiding this comment

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

Merging.

@tatsuya6502 tatsuya6502 merged commit f219d93 into main Jul 14, 2024
52 checks passed
@tatsuya6502 tatsuya6502 deleted the make-once_cell-optional branch July 14, 2024 06:08
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.

The once_cell dependency should be optional
1 participant