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 default features for time and compression #28

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Jun 29, 2024

  1. Add default features for time and compression

    This makes the `chrono` and `flate2` dependencies optional, adding a `time` and `compression` feature for each. These features are enabled by default, but can be disabled by using `default-features = false` in the Cargo.toml dependency definition, allowing library users to opt out of these dependencies if they don't need them. This should reduce compile times and binary size. In my testing on a release build I saved 1.3 seconds of compilation time (although this is very CPU dependent) and 66 KiB of binary size by dropping these features from a project that depends on file-rotate.
    
    `cfg` attributes have been added to tests to support testing with features disabled, and I've added additional test runs in the rust.yml GitHub Action to cover these cases. If you want me to add additional cargo check runs for these cases let me know and I'll do that as well. The example and doc tests only work with the default features enabled, but I think that's fine.
    
    I have not bumped the library version in Cargo.toml as I believe that should be left to the maintainer. However, note that a major version bump is needed (e.g. 0.7.6 -> 0.8.0) as this change is breaking for anyone already using `default-features = false` (even though there are currently no features someone may still be doing this for some reason). I've seen other projects get hit by this, and affected library users typically call for a cargo yank.
    zkxs committed Jun 29, 2024
    Configuration menu
    Copy the full SHA
    cfd9d7b View commit details
    Browse the repository at this point in the history

Commits on Jul 4, 2024

  1. Fix unix tests

    zkxs committed Jul 4, 2024
    Configuration menu
    Copy the full SHA
    f70c157 View commit details
    Browse the repository at this point in the history