This package has been merged into rust-mode. Please use that instead.
Format rust code in emacs using rustfmt.
Ensure you are using MELPA:
(require 'package)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
Then install the "rustfmt" package:
M-x package-list-packages
- Find the "rustfmt" and install with
I
Run M-x rustfmt-format-buffer to format the current buffer.
For convenience, you may bind it to a key, such as:
(define-key rust-mode-map (kbd "C-c C-f") #'rustfmt-format-buffer)
Alternatively, run rustfmt before saving rust buffers:
(add-hook 'rust-mode-hook #'rustfmt-enable-on-save)