From f2409b4360151601bc4189e49d9bc575edab7f17 Mon Sep 17 00:00:00 2001 From: Sven Bartscher Date: Mon, 7 Nov 2022 21:09:18 +0100 Subject: [PATCH] Fix argument handling in `rustic-cargo-clippy-rerun` 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. --- rustic-clippy.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rustic-clippy.el b/rustic-clippy.el index 2dbb6b54..182e49a9 100644 --- a/rustic-clippy.el +++ b/rustic-clippy.el @@ -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'."