You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
.emacs.d/init/flycheck/init-flycheck-cargo-has-com...

8 lines
355 B
EmacsLisp

(defun init-flycheck-rust-cargo-has-command-p (command)
(let* ((commands (process-lines "cargo" "--list"))
(trimmed (-map (lambda (row) (-slice row 4 (string-search " " 4))) commands)))
(seq-contains-p (-rest trimmed) command)))
(advice-add 'flycheck-rust-cargo-has-command-p
:override 'init-flycheck-rust-cargo-has-command-p)