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

Minor cleanup, resolve some Clippy lints #155

Merged
merged 18 commits into from
Apr 13, 2024

Commits on Apr 12, 2024

  1. Add explicit anonymous lifetime parameters

    Implicit elision of type lifetime parameters is deprecated, as per the
    rust-2018-idioms warning.
    Diomendius committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    87dc2a5 View commit details
    Browse the repository at this point in the history
  2. Take some args by reference

    Clippy's needless_pass_by_value lint shows a couple functions that don't
    need to own their arguments. undeploy() in particular takes a 240-byte
    Options struct by value but, like deploy(), doesn't need mutable access.
    Diomendius committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    9567ba0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f2aac81 View commit details
    Browse the repository at this point in the history
  4. Simplify @ binding in DryRunFilesystem::copy_file()

    Clippy's unnested-or-patterns lint caught this.
    Diomendius committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    9edf99e View commit details
    Browse the repository at this point in the history
  5. Merge identical match arms in FileTarget::condition()

    Clippy's match-same-arms lint caught this. The previous two functions
    already used or-patterns like this, but condition() was overlooked.
    Diomendius committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    8273e0d View commit details
    Browse the repository at this point in the history
  6. Remove unused &self from is_owned_by_user()

    Clippy's unused-self lint caught this.
    Diomendius committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    b5ca7a8 View commit details
    Browse the repository at this point in the history
  7. Add backtick formatting to set_owner() docs

    Clippy's doc-markdown lint caught this.
    Diomendius committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    afc4b69 View commit details
    Browse the repository at this point in the history
  8. Remove pointless clone from watch.rs

    Due to being in a move closure, this clone captures opt by value and
    then clones it. This wouldn't work even if opt were used later in the
    enclosing scope and serves no purpose as it is.
    Diomendius committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    e4ae24b View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    1e086c1 View commit details
    Browse the repository at this point in the history
  10. Use inline format args

    Clippy's uninlined-format-args lint caught this.
    Diomendius committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    b9acebb View commit details
    Browse the repository at this point in the history
  11. Hoist else branch after bail!()

    Clippy's redundant-else lint caught this.
    Diomendius committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    6f22f15 View commit details
    Browse the repository at this point in the history
  12. Add ; after assignment in FileTarget::set_path()

    Rustfmt wants this broken due to line length and requires {} for
    multiline match arms, but doesn't insert a ; because it only sees
    syntax, not types. Clippy then complains (when pedantic) about the
    implicit () return.
    
    Clippy's clippy::semicolon-if-nothing-returned lint caught this.
    Diomendius committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    dada9ca View commit details
    Browse the repository at this point in the history
  13. Remove redundant closure in config::tests

    Clippy's redundant-closure lint caught this.
    Diomendius committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    d1df781 View commit details
    Browse the repository at this point in the history
  14. Simplify asserts in tests

    Replaces `assert_eq!(x, [true|false])` with `assert!([x|!x])`.
    
    Clippy's bool-assert-comparison lint caught this.
    Diomendius committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    a64e654 View commit details
    Browse the repository at this point in the history
  15. Fix compile error in handlebars_helpers tests

    When testing without the `scripting` feature, compilation would fail
    because a `Configuration` was constructed assuming the `helpers` field
    always exists, but it only exists when `scripting` is enabled.
    Diomendius committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    7f942c1 View commit details
    Browse the repository at this point in the history
  16. Avoid mysterious Default::default()

    In `deploy::test::{low_level_simple, low_level_skip}`,
    `Default::default()` was used to construct a `BTreeMap`, with the only
    indication of the variable's type being the signature of
    `RealActionRunner::new()`, which it was passed by reference to.
    
    Clippy's default-trait-access lint caught this.
    Diomendius committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    7b99955 View commit details
    Browse the repository at this point in the history

Commits on Apr 13, 2024

  1. Use unwrap_err() instead of assert!(x.is_err())

    This is less verbose and provides a more detailed panic message.
    Diomendius committed Apr 13, 2024
    Configuration menu
    Copy the full SHA
    3481667 View commit details
    Browse the repository at this point in the history
  2. Rename config.rs test module for consistency

    `config::tests` was the only test module not named `test`.
    Diomendius committed Apr 13, 2024
    Configuration menu
    Copy the full SHA
    8ae4a9b View commit details
    Browse the repository at this point in the history