Skip to content

Commit 6ebdc4a

Browse files
committed
Add rust rfc 430.
1 parent f7511fc commit 6ebdc4a

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

clients/docstr-rust.el

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,34 @@
2626

2727
(require 'docstr)
2828

29-
(defcustom docstr-rust-style nil
29+
(defcustom docstr-rust-style 'rfc-430
3030
"Style specification for document string in Rust."
31-
:type '(choice (const :tag "No specify" nil))
31+
:type '(choice (const :tag "No specify" nil)
32+
(const :tag "RFC 430 documentation conventions" rfc-430))
3233
:group 'docstr)
3334

35+
(defcustom docstr-rust-prefix "* "
36+
"Prefix you use on each newline."
37+
:type 'string
38+
:group 'docstr)
39+
40+
(defun docstr-rust-config-rfc-430 ()
41+
"Configure for convention, RFC 430."
42+
(docstr-util-default-format)
43+
;; TODO:
44+
)
45+
3446
(defun docstr-rust-config ()
3547
"Automatically configure style according to variable `docstr-rust-style'."
3648
(cl-case docstr-rust-style
49+
(rfc-430 (docstr-rust-config-rfc-430))
3750
(t (docstr-util-default-format))))
3851

3952
;;;###autoload
4053
(defun docstr-writers-rust (search-string)
4154
"Insert document string for Rust using SEARCH-STRING."
4255
(docstr-rust-config)
43-
(let* ((start (point)) (prefix "\n* ")
56+
(let* ((start (point)) (prefix docstr-rust-prefix)
4457
(paren-param-list (docstr-writers--paren-param-list-behind search-string ":" t))
4558
(param-types (nth 0 paren-param-list))
4659
(param-vars (nth 1 paren-param-list))

0 commit comments

Comments
 (0)