Skip to content

Commit

Permalink
Error when nightly toolchain is not available.
Browse files Browse the repository at this point in the history
  • Loading branch information
rbartlensky committed Jul 10, 2021
1 parent 34f0ef7 commit 524923e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rustic-rustfmt.el
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ This operation requires a nightly version of rustfmt.
(eq major-mode 'rustic-macro-expansion-mode))
(error "Not a rustic-mode buffer."))
(if (not (region-active-p)) (rustic-format-buffer)
(unless (equal (call-process "cargo" nil nil nil "+nightly") 0)
(error "Need nightly toolchain to format region."))
(let* ((buf (current-buffer))
(file (buffer-file-name buf)))
(let ((start (+ 1 (count-lines 1 begin)))
Expand Down

0 comments on commit 524923e

Please sign in to comment.