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

Clarify documentation and simplify initialization of STATIC_MAX_LEVEL #594

Merged
merged 4 commits into from
Nov 19, 2023

Commits on Oct 20, 2023

  1. Clarify release builds using max_level_* features

    Rephrase the documentation to make it clear that the max_level_* and
    release_max_level_* are not separate ways of setting STATIC_MAX_LEVEL
    for respectively debug and release builds but instead, that max_level_*
    are used by all builds and that release_max_level_* are just a way to
    override them.
    ptosi committed Oct 20, 2023
    Configuration menu
    Copy the full SHA
    fa8ff87 View commit details
    Browse the repository at this point in the history
  2. Add feature-dependent tests for STATIC_MAX_LEVEL

    Add unit tests that check, for the current configuration of the crate
    features, that STATIC_MAX_LEVEL has the appropriate value. As the
    features are statically set (at build time), coverage of all the
    max_level_* and release_max_level_* value pairs must be achieved by
    launching cargo with different sets:
    
        levels="off debug error info trace warn"
        for i in '' $levels; do
            release=${i:+--features=release_max_level_${i}}
            for j in '' $levels; do
                debug=${j:+--features=max_level_${j}}
                cargo test static_max_level ${release} ${debug}
                cargo test static_max_level ${release} ${debug} --release
            done
        done
    ptosi committed Oct 20, 2023
    Configuration menu
    Copy the full SHA
    cc7efd8 View commit details
    Browse the repository at this point in the history
  3. Simplify STATIC_MAX_LEVEL intialization

    Replace get_max_level_inner() with cfg!() and a const-compatible match,
    now that the MSRV has been bumped to 1.60.0.
    ptosi committed Oct 20, 2023
    Configuration menu
    Copy the full SHA
    296fa1a View commit details
    Browse the repository at this point in the history
  4. Remove intermediate MAX_LEVEL_INNER

    Drop the constant as it now seems unnecessary.
    
    Note: this is done in a separate commit to be easy to bisect and revert.
    ptosi committed Oct 20, 2023
    Configuration menu
    Copy the full SHA
    05d8c46 View commit details
    Browse the repository at this point in the history