File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 1717
1818(eval-when-compile (require 'rx ))
1919
20+ (defvar rust-load-optional-libraries t
21+ " Whether loading `rust-mode' also loads optional libraries.
22+ This variable might soon be remove again." )
23+
24+ (when rust-load-optional-libraries
25+ (require 'rust-cargo )
26+ (require 'rust-compile )
27+ (require 'rust-playpen )
28+ (require 'rust-rustfmt ))
29+
2030(defvar electric-pair-inhibit-predicate )
2131(defvar electric-pair-skip-self )
2232(defvar electric-indent-chars )
@@ -188,9 +198,10 @@ Use idomenu (imenu with `ido-mode') for best mileage.")
188198
189199(defvar rust-mode-map
190200 (let ((map (make-sparse-keymap )))
191- (define-key map (kbd " C-c C-f" ) 'rust-format-buffer )
192201 (define-key map (kbd " C-c C-d" ) 'rust-dbg-wrap-or-unwrap )
193- (define-key map (kbd " C-c C-n" ) 'rust-goto-format-problem )
202+ (when rust-load-optional-libraries
203+ (define-key map (kbd " C-c C-f" ) 'rust-format-buffer )
204+ (define-key map (kbd " C-c C-n" ) 'rust-goto-format-problem ))
194205 map)
195206 " Keymap for Rust major mode." )
196207
You can’t perform that action at this time.
0 commit comments