Skip to content

Commit

Permalink
Fix argument handling in rustic-cargo-clippy-rerun
Browse files Browse the repository at this point in the history
This fixes two separate bugs.

The first caused `rustic-cargo-clippy-rerun` to not pass any effective
arguments to `rustic-cargo-clippy-run`, so the resulting run would
always have no arguments.

The second causes `rustic-cargo-clippy-rerun` to pass
`rustic-clippy-arguments` even when it's not set. This was
inconsistent with `rustic-cargo-clippy` which would fall back to
`rustic-default-clippy-arguments` when `rustic-clippy-arguments` was
empty.
  • Loading branch information
Kritzefitz committed Nov 7, 2022
1 parent 4879922 commit f2409b4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rustic-clippy.el
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ When calling this function from `rustic-popup-mode', always use the value of
(defun rustic-cargo-clippy-rerun ()
"Run 'cargo clippy' with `rustic-clippy-arguments'."
(interactive)
(rustic-cargo-clippy-run rustic-clippy-arguments))
(rustic-cargo-clippy-run :params (if (> (length rustic-clippy-arguments) 0)
rustic-clippy-arguments
rustic-default-clippy-arguments)))

(defun rustic-cargo-clippy-fix (&rest args)
"Run 'clippy fix'."
Expand Down

0 comments on commit f2409b4

Please sign in to comment.