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

Avoid new lints in 1.81.0 #337

Merged
merged 7 commits into from
Sep 23, 2024

Commits on Sep 23, 2024

  1. ci: Update the 'recent hardcoded version' to 1.81

    This is used for clippy lints.
    Techcable committed Sep 23, 2024
    Configuration menu
    Copy the full SHA
    dd71956 View commit details
    Browse the repository at this point in the history
  2. build: Avoid check-cfg lint in 1.81.0

    Config names are now validated at compile time:
    https://blog.rust-lang.org/2024/05/06/check-cfg.html
    Techcable committed Sep 23, 2024
    Configuration menu
    Copy the full SHA
    98c97c8 View commit details
    Browse the repository at this point in the history
  3. Rename ./cargo/config to .cargo/config.toml

    This avoids the following warning:
    ```
    warning: `/Users/nicholas/git/slog.org/slog/.cargo/config` is deprecated in favor of `config.toml`
    note: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml`
    ```
    
    Since our MSRV is currently 1.49, we can safely make this change
    without needing a system link.
    Techcable committed Sep 23, 2024
    Configuration menu
    Copy the full SHA
    24a2e99 View commit details
    Browse the repository at this point in the history
  4. test_edition2018: Explicitly specify edition = "2018"

    Avoids a cargo warning
    Techcable committed Sep 23, 2024
    Configuration menu
    Copy the full SHA
    5004dc9 View commit details
    Browse the repository at this point in the history
  5. Remove unused extern crate declarations

    These declarations are not needed.
    This avoids the #[deny(unused_extern_crates)] lint, implied by #[deny(rust_2018_idioms)]
    
    This error only occurs when the `nested-values` feature is enabled.
    This error also seems to only occur on new versions (ex. 1.72 is fine).
    
    Switch #[deny(rust_2018_idioms)] to #[warn(...)] to avoid unnecessary
    build failures in the future.
    Techcable committed Sep 23, 2024
    Configuration menu
    Copy the full SHA
    c0b05f6 View commit details
    Browse the repository at this point in the history
  6. Unconditionally import from alloc/core

    Instead of doing this:
    ```
     #[cfg(not(feature = "std"))]
     use alloc::borrow::Cow;
     #[cfg(feature = "std")]
     use std::borrow::Cow;
    ```
    
    Just unconditionally import from alloc:
    ```
    use alloc::borrow::Cow;
    ```
    
    Enable #[warn(clippy::std_instead_of_alloc, clippy::std_instead_of_core)]
    to warn about these imports in the future.
    
    Conditionally declare #[no_std] if and only if not(cfg(feature = "std"))
    This is cleaner and avoids an `extern crate std` declaration,
    but semantically there should be no difference.
    Techcable committed Sep 23, 2024
    Configuration menu
    Copy the full SHA
    7554cb9 View commit details
    Browse the repository at this point in the history
  7. doc: Fix "lazy continuation" in slog::Logger

    This is a mistake in markdown syntax, caught by a clippy lint:
    https://rust-lang.github.io/rust-clippy/rust-1.81.0/index.html#/doc_lazy_continuation
    Techcable committed Sep 23, 2024
    Configuration menu
    Copy the full SHA
    4e24c23 View commit details
    Browse the repository at this point in the history