This repository has been archived by the owner on Nov 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 165
/
Copy pathrust.json
74 lines (74 loc) · 1.63 KB
/
rust.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
{
"extern crate": {
"prefix": "extern crate",
"body": [
"extern crate ${1:name};"
],
"description": "Insert extern crate"
},
"for": {
"prefix": "for",
"body": [
"for ${1:elem} in ${2:iter} {",
"\t$0",
"}"
],
"description": "Insert for loop"
},
"macro_rules": {
"prefix": "macro_rules",
"body": [
"macro_rules! $1 {",
"\t($2) => {",
"\t\t$0",
"\t};",
"}"
],
"description": "Insert macro_rules!"
},
"if let": {
"prefix": "if let",
"body": [
"if let ${1:pattern} = ${2:value} {",
"\t$3",
"}"
],
"description": "Insert if to match a specific pattern, useful for enum variants e.g. `Some(inner)`"
},
"spawn": {
"prefix": [
"thread_spawn",
"spawn"
],
"body": [
"std::thread::spawn(move || {",
"\t$1",
"})"
],
"description": "Wrap code in thread::spawn"
},
"derive": {
"prefix": "derive",
"body": [
"#[derive(${1})]"
],
"description": "#[derive(…)]"
},
"cfg": {
"prefix": "cfg",
"body": [
"#[cfg(${1})]"
],
"description": "#[cfg(…)]"
},
"test": {
"prefix": "test",
"body": [
"#[test]",
"fn ${1:name}() {",
" ${2:unimplemented!();}",
"}"
],
"description": "#[test]"
}
}