rustic icon indicating copy to clipboard operation
rustic copied to clipboard

rustic-cargo-build-exec-command doesn't appear to allow specification of toolchain

Open GavinMendelGleason opened this issue 1 year ago • 0 comments

Perhaps I have the wrong end of the stick but it seems that it's not possible to specify a toolchain here. Perhaps the rustic-cargo-build-exec-command could use split-string as the rustic-cargo-bulid-arguments does?

For instance, the following:

;;;###autoload
(defun rustic-cargo-build (&optional arg)
  "Run 'cargo build' for the current project, allow configuring
`rustic-cargo-build-arguments' when prefix argument (C-u) is enabled."
  (interactive "P")
  (when arg
    (setq rustic-cargo-build-arguments
          (read-string "Cargo build arguments: " "")))
  (rustic-run-cargo-command `(,(rustic-cargo-bin)
                              ,rustic-cargo-build-exec-command
                              ,@(split-string rustic-cargo-build-arguments))
                            (list :clippy-fix t)))

Could be backward compatibly replaced with:

;;;###autoload
(defun rustic-cargo-build (&optional arg)
  "Run 'cargo build' for the current project, allow configuring
`rustic-cargo-build-arguments' when prefix argument (C-u) is enabled."
  (interactive "P")
  (when arg
    (setq rustic-cargo-build-arguments
          (read-string "Cargo build arguments: " "")))
  (rustic-run-cargo-command `(,(rustic-cargo-bin)
                              ,@(split-string rustic-cargo-build-exec-command)
                              ,@(split-string rustic-cargo-build-arguments))
                            (list :clippy-fix t)))

And then the following would work:

(setq rustic-cargo-build-exec-command "+nightly build")

GavinMendelGleason avatar May 28 '23 09:05 GavinMendelGleason