diff options
| author | jao <jao@gnu.org> | 2026-09-27 19:10:27 +0100 |
|---|---|---|
| committer | jao <jao@gnu.org> | 2026-09-27 19:11:13 +0100 |
| commit | 3cddb04911e74cd66b6cd1ce179abad4fe462a4f (patch) | |
| tree | 8f4c8f03dd74814c03a24ee8922123adfaf8ddcb /lib | |
| parent | 2fe17b001ea9b5e008b45b9e556193074edbdcfc (diff) | |
| download | elibs-3cddb04911e74cd66b6cd1ce179abad4fe462a4f.tar.gz elibs-3cddb04911e74cd66b6cd1ce179abad4fe462a4f.tar.bz2 | |
rust nits
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/prog/jao-rust.el | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/prog/jao-rust.el b/lib/prog/jao-rust.el index 53b0058..ddb3307 100644 --- a/lib/prog/jao-rust.el +++ b/lib/prog/jao-rust.el @@ -49,6 +49,12 @@ (replace-regexp-in-string "\\(^\\|/\\)\\(mod\\|lib\\|main\\)$" "") (string-replace "/" "::"))))) +;;;###autoload +(define-minor-mode jao-rust-show-module-mode + "Show the current file's module in the mode line lighter" + :lighter (:eval (if-let* ((m (jao-rust-current-module-name))) + (format " ::%s" m)))) + (defun jao-rust--tests-prefix () (let ((m (jao-rust-current-module-name))) (cond ((not (stringp m)) "") @@ -72,6 +78,7 @@ (defconst jao-rust--tests-mod-rx "^\\(pub\\)? *mod tests {") +;;;###autoload (defun jao-rust-goto-tests () (interactive) (or (re-search-forward jao-rust--tests-mod-rx nil t) @@ -84,6 +91,7 @@ (insert "\n#[cfg(test)]\nmod tests {\n\n}") (forward-line -1)))) +;;;###autoload (defun jao-rust-test-current () (interactive) (if-let* ((m (jao-rust--tests-prefix)) @@ -102,6 +110,7 @@ (when-let* ((name (jao-rust-test-at-point))) (push name res))) res))) +;;;###autoload (defun jao-rust-test-module () (interactive) (let ((tests (jao-rust-buffer-tests))) @@ -114,6 +123,7 @@ (rustic-cargo-use-last-stored-arguments t)) (rustic-cargo-test))))) +;;;###autoload (defun jao-rust-test-doctests (&optional all) (interactive "P") (let* ((m (if all "" (jao-rust-current-module-name))) @@ -122,18 +132,21 @@ (rustic-cargo-use-last-stored-arguments t)) (rustic-cargo-test))) +;;;###autoload (defun jao-rust-retest () (interactive) (let* ((rustic-test-arguments "-R latest") (rustic-cargo-use-last-stored-arguments t)) (rustic-cargo-test))) +;;;###autoload (defun jao-rust-test-workspace () (interactive) (let ((rustic-test-arguments rustic-default-test-arguments)) (rustic-cargo-test))) +;;;###autoload (defun jao-rust-build-doc (deps) (interactive "P") (rustic-run-cargo-command `(,(rustic-cargo-bin) "doc" ,@(unless deps '("--no-deps"))))) |
