From 5e30c3fe1b79b44d908ca4f5ad9e286ccf1d38f4 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Wed, 13 Jan 2021 10:06:40 -0500 Subject: [PATCH] feat(gs/emacs): Add new snippets for rust-mode Add snippets for async tests and benchmarks Change-Id: Ic1ad46c7f76b1e68c4043a13e821583195c661ab Reviewed-on: https://cl.tvl.fyi/c/depot/+/2353 Tested-by: BuildkiteCI Reviewed-by: glittershark --- .../glittershark/emacs.d/snippets/rust-mode/async test | 10 ++++++++++ .../glittershark/emacs.d/snippets/rust-mode/benchmark | 10 ++++++++++ 2 files changed, 20 insertions(+) create mode 100644 users/glittershark/emacs.d/snippets/rust-mode/async test create mode 100644 users/glittershark/emacs.d/snippets/rust-mode/benchmark diff --git a/users/glittershark/emacs.d/snippets/rust-mode/async test b/users/glittershark/emacs.d/snippets/rust-mode/async test new file mode 100644 index 000000000..b48e443cb --- /dev/null +++ b/users/glittershark/emacs.d/snippets/rust-mode/async test @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: async test +# uuid: +# key: atest +# condition: t +# -- +#[tokio::test(threaded_scheduler)] +async fn ${1:test_name}() { + `%`$0 +} \ No newline at end of file diff --git a/users/glittershark/emacs.d/snippets/rust-mode/benchmark b/users/glittershark/emacs.d/snippets/rust-mode/benchmark new file mode 100644 index 000000000..f1446923a --- /dev/null +++ b/users/glittershark/emacs.d/snippets/rust-mode/benchmark @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: benchmark +# uuid: +# key: bench +# condition: t +# -- +#[bench] +fn ${1:benchmark_name}(b: &mut Bencher) { + `%`b.iter(|| $0); +} \ No newline at end of file