summaryrefslogtreecommitdiff
path: root/rust-mode
diff options
context:
space:
mode:
Diffstat (limited to 'rust-mode')
-rw-r--r--rust-mode/allow5
-rw-r--r--rust-mode/allow!5
-rw-r--r--rust-mode/assert5
-rw-r--r--rust-mode/asserteq5
-rw-r--r--rust-mode/case5
-rw-r--r--rust-mode/cfg5
-rw-r--r--rust-mode/cfg=5
-rw-r--r--rust-mode/closure7
-rw-r--r--rust-mode/deny5
-rw-r--r--rust-mode/deny!5
-rw-r--r--rust-mode/derive5
-rw-r--r--rust-mode/drop9
-rw-r--r--rust-mode/enum7
-rw-r--r--rust-mode/fn7
-rw-r--r--rust-mode/fnr7
-rw-r--r--rust-mode/fns5
-rw-r--r--rust-mode/fnw7
-rw-r--r--rust-mode/for7
-rw-r--r--rust-mode/if7
-rw-r--r--rust-mode/ife9
-rw-r--r--rust-mode/ifl5
-rw-r--r--rust-mode/impl7
-rw-r--r--rust-mode/implt7
-rw-r--r--rust-mode/let5
-rw-r--r--rust-mode/letm5
-rw-r--r--rust-mode/lett5
-rw-r--r--rust-mode/lettm5
-rw-r--r--rust-mode/loop7
-rw-r--r--rust-mode/macro7
-rw-r--r--rust-mode/main7
-rw-r--r--rust-mode/match7
-rw-r--r--rust-mode/print5
-rw-r--r--rust-mode/println5
-rw-r--r--rust-mode/spawn7
-rw-r--r--rust-mode/static5
-rw-r--r--rust-mode/struct7
-rw-r--r--rust-mode/test8
-rw-r--r--rust-mode/testmod13
-rw-r--r--rust-mode/trait7
-rw-r--r--rust-mode/type5
-rw-r--r--rust-mode/warn5
-rw-r--r--rust-mode/warn!5
-rw-r--r--rust-mode/while7
-rw-r--r--rust-mode/whilel7
44 files changed, 275 insertions, 0 deletions
diff --git a/rust-mode/allow b/rust-mode/allow
new file mode 100644
index 0000000..c30c1e8
--- /dev/null
+++ b/rust-mode/allow
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: #[allow(lint)]
+# key: allow
+# --
+#[allow(${1:lint})] \ No newline at end of file
diff --git a/rust-mode/allow! b/rust-mode/allow!
new file mode 100644
index 0000000..cfb0c7d
--- /dev/null
+++ b/rust-mode/allow!
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: #![allow(lint)]
+# key: allow!
+# --
+#![allow(${1:lint})] \ No newline at end of file
diff --git a/rust-mode/assert b/rust-mode/assert
new file mode 100644
index 0000000..d1252d0
--- /dev/null
+++ b/rust-mode/assert
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: assert!(predicate);
+# key: ass
+# --
+assert!(${1:predicate}); \ No newline at end of file
diff --git a/rust-mode/asserteq b/rust-mode/asserteq
new file mode 100644
index 0000000..7bfafd2
--- /dev/null
+++ b/rust-mode/asserteq
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: assert_eq!(expected, actual);
+# key: asseq
+# --
+assert_eq!(${1:expected}, ${2:actual}); \ No newline at end of file
diff --git a/rust-mode/case b/rust-mode/case
new file mode 100644
index 0000000..9ea6609
--- /dev/null
+++ b/rust-mode/case
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: pattern => expression,
+# key: case
+# --
+${1:pattern} => ${2:expression}, \ No newline at end of file
diff --git a/rust-mode/cfg b/rust-mode/cfg
new file mode 100644
index 0000000..583e021
--- /dev/null
+++ b/rust-mode/cfg
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: #[cfg(option)]
+# key: cfg
+# --
+#[cfg(${1:option})] \ No newline at end of file
diff --git a/rust-mode/cfg= b/rust-mode/cfg=
new file mode 100644
index 0000000..b01a458
--- /dev/null
+++ b/rust-mode/cfg=
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: #[cfg(option = "value")]
+# key: cfg=
+# --
+#[cfg(${1:option} = "${2:value}")] \ No newline at end of file
diff --git a/rust-mode/closure b/rust-mode/closure
new file mode 100644
index 0000000..89c2d01
--- /dev/null
+++ b/rust-mode/closure
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: closure
+# key: ||
+# --
+|${1:arguments}| {
+ $0
+}
diff --git a/rust-mode/deny b/rust-mode/deny
new file mode 100644
index 0000000..5b7f3d9
--- /dev/null
+++ b/rust-mode/deny
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: #[deny(lint)]
+# key: deny
+# --
+#[deny(${1:lint})] \ No newline at end of file
diff --git a/rust-mode/deny! b/rust-mode/deny!
new file mode 100644
index 0000000..c4c85c5
--- /dev/null
+++ b/rust-mode/deny!
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: #![deny(lint)]
+# key: deny!
+# --
+#![deny(${1:lint})]
diff --git a/rust-mode/derive b/rust-mode/derive
new file mode 100644
index 0000000..581c86f
--- /dev/null
+++ b/rust-mode/derive
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: #[derive(Trait)]
+# key: derive
+# --
+#[derive(${1:Trait})] \ No newline at end of file
diff --git a/rust-mode/drop b/rust-mode/drop
new file mode 100644
index 0000000..310d0ad
--- /dev/null
+++ b/rust-mode/drop
@@ -0,0 +1,9 @@
+# -*- mode: snippet -*-
+# name: impl Drop for Type { fn drop(...) }
+# key: drop
+# --
+impl Drop for ${1:Type} {
+ fn drop(&mut self) {
+ $0
+ }
+} \ No newline at end of file
diff --git a/rust-mode/enum b/rust-mode/enum
new file mode 100644
index 0000000..058aadc
--- /dev/null
+++ b/rust-mode/enum
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: enum Type { ... }
+# key: enum
+# --
+enum ${1:Type} {
+ $0
+} \ No newline at end of file
diff --git a/rust-mode/fn b/rust-mode/fn
new file mode 100644
index 0000000..459fd49
--- /dev/null
+++ b/rust-mode/fn
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: fn name() { ... }
+# key: fn
+# --
+fn ${1:name}($2) {
+ $0
+} \ No newline at end of file
diff --git a/rust-mode/fnr b/rust-mode/fnr
new file mode 100644
index 0000000..4a4db71
--- /dev/null
+++ b/rust-mode/fnr
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: fn name() -> Type { ... }
+# key: fnr
+# --
+fn ${1:name}($2) -> ${3:Type} {
+ $0
+} \ No newline at end of file
diff --git a/rust-mode/fns b/rust-mode/fns
new file mode 100644
index 0000000..6d2c828
--- /dev/null
+++ b/rust-mode/fns
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: fn name(&self) -> Type;
+# key: fns
+# --
+fn ${1:name}(${2:&self}) -> ${3:Type}; \ No newline at end of file
diff --git a/rust-mode/fnw b/rust-mode/fnw
new file mode 100644
index 0000000..77bee6e
--- /dev/null
+++ b/rust-mode/fnw
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: fn name<T>(x: T) where T: Clone { ... }
+# key: fnw
+# --
+fn ${1:name}<${2:T}>(${3:x: T}) where ${4:T: Clone} {
+ $0
+} \ No newline at end of file
diff --git a/rust-mode/for b/rust-mode/for
new file mode 100644
index 0000000..66dca09
--- /dev/null
+++ b/rust-mode/for
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: for var in iterable { ... }
+# key: for
+# --
+for ${1:var} in ${2:iterable} {
+ $0
+} \ No newline at end of file
diff --git a/rust-mode/if b/rust-mode/if
new file mode 100644
index 0000000..c793ace
--- /dev/null
+++ b/rust-mode/if
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: if expr { ... }
+# key: if
+# --
+if ${1:expression} {
+ $0
+} \ No newline at end of file
diff --git a/rust-mode/ife b/rust-mode/ife
new file mode 100644
index 0000000..c738d4b
--- /dev/null
+++ b/rust-mode/ife
@@ -0,0 +1,9 @@
+# -*- mode: snippet -*-
+# name: if expression { ... } else { .. }
+# key: ife
+# --
+if ${1:expression} {
+ $0
+} else {
+
+} \ No newline at end of file
diff --git a/rust-mode/ifl b/rust-mode/ifl
new file mode 100644
index 0000000..177a359
--- /dev/null
+++ b/rust-mode/ifl
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: if let pattern = expression { ... };
+# key: ifl
+# --
+if let ${1:pattern} = ${2:expression} { $0 }; \ No newline at end of file
diff --git a/rust-mode/impl b/rust-mode/impl
new file mode 100644
index 0000000..2d90db9
--- /dev/null
+++ b/rust-mode/impl
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: impl Type { ... }
+# key: impl
+# --
+impl ${1:Type} {
+ $0
+} \ No newline at end of file
diff --git a/rust-mode/implt b/rust-mode/implt
new file mode 100644
index 0000000..54269df
--- /dev/null
+++ b/rust-mode/implt
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: impl Trait for Type { ... }
+# key: implt
+# --
+impl ${1:Trait} for ${2:Type} {
+ $0
+} \ No newline at end of file
diff --git a/rust-mode/let b/rust-mode/let
new file mode 100644
index 0000000..9f603ea
--- /dev/null
+++ b/rust-mode/let
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: let pattern = expression;
+# key: let
+# --
+let ${1:pattern} = ${2:expression}; \ No newline at end of file
diff --git a/rust-mode/letm b/rust-mode/letm
new file mode 100644
index 0000000..b07d673
--- /dev/null
+++ b/rust-mode/letm
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: let mut pattern = expression;
+# key: letm
+# --
+let mut ${1:pattern} = ${2:expression}; \ No newline at end of file
diff --git a/rust-mode/lett b/rust-mode/lett
new file mode 100644
index 0000000..10a7fa6
--- /dev/null
+++ b/rust-mode/lett
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: let pattern: type = expression;
+# key: lett
+# --
+let ${1:pattern}: ${2:type} = ${3:expression}; \ No newline at end of file
diff --git a/rust-mode/lettm b/rust-mode/lettm
new file mode 100644
index 0000000..9ceb8c3
--- /dev/null
+++ b/rust-mode/lettm
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: let mut pattern: type = expression;
+# key: lettm
+# --
+let mut ${1:pattern}: ${2:type} = ${3:expression}; \ No newline at end of file
diff --git a/rust-mode/loop b/rust-mode/loop
new file mode 100644
index 0000000..2285b75
--- /dev/null
+++ b/rust-mode/loop
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: loop { ... }
+# key: loop
+# --
+loop {
+ $0
+} \ No newline at end of file
diff --git a/rust-mode/macro b/rust-mode/macro
new file mode 100644
index 0000000..b07f748
--- /dev/null
+++ b/rust-mode/macro
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: macro_rules! name { (..) => (..); }
+# key: macro
+# --
+macro_rules! ${1:name} {
+ ($2) => ($3);
+} \ No newline at end of file
diff --git a/rust-mode/main b/rust-mode/main
new file mode 100644
index 0000000..75ae143
--- /dev/null
+++ b/rust-mode/main
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: fn main() { ... }
+# key: main
+# --
+fn main() {
+ $0
+} \ No newline at end of file
diff --git a/rust-mode/match b/rust-mode/match
new file mode 100644
index 0000000..54b7c80
--- /dev/null
+++ b/rust-mode/match
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: match expression { ... }
+# key: match
+# --
+match ${1:expression} {
+ $0
+} \ No newline at end of file
diff --git a/rust-mode/print b/rust-mode/print
new file mode 100644
index 0000000..11ba7c8
--- /dev/null
+++ b/rust-mode/print
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: print!("{}", value);
+# key: print
+# --
+print!("${1:{}}", $2); \ No newline at end of file
diff --git a/rust-mode/println b/rust-mode/println
new file mode 100644
index 0000000..23bfe7c
--- /dev/null
+++ b/rust-mode/println
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: println!("{}", value);
+# key: println
+# --
+println!("${1:{}}", $2);
diff --git a/rust-mode/spawn b/rust-mode/spawn
new file mode 100644
index 0000000..6ed5c5e
--- /dev/null
+++ b/rust-mode/spawn
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: spawn(proc() { ... });
+# key: spawn
+# --
+spawn(proc() {
+ $0
+});
diff --git a/rust-mode/static b/rust-mode/static
new file mode 100644
index 0000000..eef8072
--- /dev/null
+++ b/rust-mode/static
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: CONSTANT: Type = value;
+# key: static
+# --
+static ${1:CONSTANT}: ${2:Type} = ${3:value}; \ No newline at end of file
diff --git a/rust-mode/struct b/rust-mode/struct
new file mode 100644
index 0000000..1c2e4c8
--- /dev/null
+++ b/rust-mode/struct
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: struct TypeName { .. }
+# key: struct
+# --
+struct ${1:TypeName} {
+ $0
+} \ No newline at end of file
diff --git a/rust-mode/test b/rust-mode/test
new file mode 100644
index 0000000..5f4ab7f
--- /dev/null
+++ b/rust-mode/test
@@ -0,0 +1,8 @@
+# -*- mode: snippet -*-
+# name: #[test] fn test_name() { .. }
+# key: test
+# --
+#[test]
+fn ${1:test_name}() {
+ $0
+}
diff --git a/rust-mode/testmod b/rust-mode/testmod
new file mode 100644
index 0000000..8f6e112
--- /dev/null
+++ b/rust-mode/testmod
@@ -0,0 +1,13 @@
+# -*- mode: snippet -*-
+# name: test module
+# key: testmod
+# --
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn ${1:test_name}() {
+ $0
+ }
+}
diff --git a/rust-mode/trait b/rust-mode/trait
new file mode 100644
index 0000000..15ab201
--- /dev/null
+++ b/rust-mode/trait
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: trait Type { ... }
+# key: trait
+# --
+trait ${1:Type} {
+ $0
+} \ No newline at end of file
diff --git a/rust-mode/type b/rust-mode/type
new file mode 100644
index 0000000..584a089
--- /dev/null
+++ b/rust-mode/type
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: type TypeName = TypeName;
+# key: type
+# --
+type ${1:TypeName} = ${2:TypeName}; \ No newline at end of file
diff --git a/rust-mode/warn b/rust-mode/warn
new file mode 100644
index 0000000..acf5c5c
--- /dev/null
+++ b/rust-mode/warn
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: #[warn(lint)]
+# key: warn
+# --
+#[warn(${1:lint})] \ No newline at end of file
diff --git a/rust-mode/warn! b/rust-mode/warn!
new file mode 100644
index 0000000..2f4885d
--- /dev/null
+++ b/rust-mode/warn!
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: #![warn(lint)]
+# key: warn!
+# --
+#![warn(${1:lint})] \ No newline at end of file
diff --git a/rust-mode/while b/rust-mode/while
new file mode 100644
index 0000000..2fa221a
--- /dev/null
+++ b/rust-mode/while
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: while expression { ... }
+# key: while
+# --
+while ${1:expression} {
+ $0
+} \ No newline at end of file
diff --git a/rust-mode/whilel b/rust-mode/whilel
new file mode 100644
index 0000000..6cf9ac3
--- /dev/null
+++ b/rust-mode/whilel
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: while let pattern = expression { ... }
+# key: whilel
+# --
+while let ${1:pattern} = ${2:expression} {
+ $0
+}