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 cdf8ea7
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 @@ -209,6 +209,8 @@ This operation requires a nightly version of rustfmt.
(if (not (region-active-p)) (rustic-format-buffer)
(let* ((buf (current-buffer))
(file (buffer-file-name buf)))
(unless (equal (call-process "cargo" nil nil nil "+nightly") 0)
(error "Need nightly toolchain to format region."))
(let ((start (+ 1 (count-lines 1 begin)))
(len (- (count-lines begin end) 1)))
(rustic-compilation-process-live t)
Expand Down

0 comments on commit cdf8ea7

Please sign in to comment.