(when (maybe-require-package 'rust-mode)
  (when (maybe-require-package 'racer)
    (add-hook 'rust-mode-hook #'racer-mode)
    (add-hook 'racer-mode-hook #'eldoc-mode)))

(when (maybe-require-package 'flycheck-rust)
  (add-hook 'flycheck-mode-hook #'flycheck-rust-setup))

(provide 'init-rust)

(when (maybe-require-package 'rust-mode)
  (when (maybe-require-package 'racer)
    (add-hook 'rust-mode-hook #'racer-mode)
    (add-hook 'racer-mode-hook #'eldoc-mode))
  (when (maybe-require-package 'company)
    (add-hook 'racer-mode-hook #'company-mode)))

(when (maybe-require-package 'flycheck-rust)
  (add-hook 'flycheck-mode-hook #'flycheck-rust-setup))

(provide 'init-rust)

Add rust racer autocompletion with company
Add rust racer autocompletion with company

dcorking/emacs.d