summaryrefslogtreecommitdiff
path: root/config/flycheck/config-flycheck-cargo-has-command-p-fix.el
blob: 1135165076487a6206b0aa6ca4f80b1f86fd945a (plain)
1
2
3
4
5
6
7
(defun config-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 'config-flycheck-rust-cargo-has-command-p)