about summary refs log tree commit diff
path: root/users/aspen/emacs/snippets/rust-mode
diff options
context:
space:
mode:
Diffstat (limited to 'users/aspen/emacs/snippets/rust-mode')
-rw-r--r--users/aspen/emacs/snippets/rust-mode/#[macro_use]5
-rw-r--r--users/aspen/emacs/snippets/rust-mode/async test10
-rw-r--r--users/aspen/emacs/snippets/rust-mode/benchmark10
-rw-r--r--users/aspen/emacs/snippets/rust-mode/proptest10
-rw-r--r--users/aspen/emacs/snippets/rust-mode/test-module11
-rw-r--r--users/aspen/emacs/snippets/rust-mode/tests9
6 files changed, 55 insertions, 0 deletions
diff --git a/users/aspen/emacs/snippets/rust-mode/#[macro_use] b/users/aspen/emacs/snippets/rust-mode/#[macro_use]
new file mode 100644
index 000000000000..fea942a337f6
--- /dev/null
+++ b/users/aspen/emacs/snippets/rust-mode/#[macro_use]
@@ -0,0 +1,5 @@
+# key: macro_use
+# name: #[macro_use]
+# --
+#[macro_use]
+${1:extern crate} ${2:something};$0
diff --git a/users/aspen/emacs/snippets/rust-mode/async test b/users/aspen/emacs/snippets/rust-mode/async test
new file mode 100644
index 000000000000..2352d7b56bcc
--- /dev/null
+++ b/users/aspen/emacs/snippets/rust-mode/async test
@@ -0,0 +1,10 @@
+# -*- mode: snippet -*-
+# name: async test
+# uuid: atest
+# key: atest
+# condition: t
+# --
+#[tokio::test${1:(flavor = "multi_thread")}]
+async fn ${2:test_name}() {
+   `%`$0
+}
\ No newline at end of file
diff --git a/users/aspen/emacs/snippets/rust-mode/benchmark b/users/aspen/emacs/snippets/rust-mode/benchmark
new file mode 100644
index 000000000000..9ec43075380b
--- /dev/null
+++ b/users/aspen/emacs/snippets/rust-mode/benchmark
@@ -0,0 +1,10 @@
+# -*- mode: snippet -*-
+# name: benchmark
+# uuid: benchmark
+# key: bench
+# condition: t
+# --
+#[bench]
+fn ${1:benchmark_name}(b: &mut Bencher) {
+   `%`b.iter(|| $0);
+}
\ No newline at end of file
diff --git a/users/aspen/emacs/snippets/rust-mode/proptest b/users/aspen/emacs/snippets/rust-mode/proptest
new file mode 100644
index 000000000000..be12af49113a
--- /dev/null
+++ b/users/aspen/emacs/snippets/rust-mode/proptest
@@ -0,0 +1,10 @@
+# -*- mode: snippet -*-
+# name: proptest
+# uuid: proptest
+# key: proptest
+# condition: t
+# --
+#[proptest]
+fn ${1:test_name}($2) {
+   `%`$0
+}
\ No newline at end of file
diff --git a/users/aspen/emacs/snippets/rust-mode/test-module b/users/aspen/emacs/snippets/rust-mode/test-module
new file mode 100644
index 000000000000..bfa2ca2d1881
--- /dev/null
+++ b/users/aspen/emacs/snippets/rust-mode/test-module
@@ -0,0 +1,11 @@
+# -*- mode: snippet -*-
+# name: test-module
+# uuid: test-module
+# key: tmod
+# condition: t
+# --
+mod $1 {
+    use super::*;
+
+    $0
+}
\ No newline at end of file
diff --git a/users/aspen/emacs/snippets/rust-mode/tests b/users/aspen/emacs/snippets/rust-mode/tests
new file mode 100644
index 000000000000..0a476ab58661
--- /dev/null
+++ b/users/aspen/emacs/snippets/rust-mode/tests
@@ -0,0 +1,9 @@
+# key: tests
+# name: test module
+# --
+#[cfg(test)]
+mod ${1:tests} {
+    use super::*;
+
+    $0
+}