branch: elpa/rust-mode
commit 72f795da4ce911939e4156964bc8be5f159d00ab
Author: Tristan Cacqueray <[email protected]>
Commit: Tristan Cacqueray <[email protected]>
Add rust-run and rust-test interactive function
This change adds a couple of useful commands similar to the
rust-build function.
---
rust-mode.el | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/rust-mode.el b/rust-mode.el
index a8af671..d2e9ff1 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -1502,6 +1502,16 @@ This is written mainly to be used as
`end-of-defun-function' for Rust."
(interactive)
(compile "cargo build"))
+(defun rust-run ()
+ "Run using `cargo run`"
+ (interactive)
+ (compile "cargo run"))
+
+(defun rust-test ()
+ "Test using `cargo test`"
+ (interactive)
+ (compile "cargo test"))
+
(defvar rust-mode-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "C-c C-f") 'rust-format-buffer)