Skip to content

Commit 6d2e40b

Browse files
authored
Merge pull request rust-lang#321 from OnlyLys/master
Add assert!() and assert_eq!() snippets.
2 parents 11d61e3 + 31b1879 commit 6d2e40b

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ the following snippets:
8787
* `unimplemented`
8888
* `unreachable`
8989
* `println`
90+
* `assert` and `assert_eq`
9091
* `macro_rules` - declare a macro
9192
* `if let Option` - an `if let` statement for executing code only in the `Some`
9293
case.

snippets/rust.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,20 @@
3636
],
3737
"description": "Insert println!"
3838
},
39+
"assert": {
40+
"prefix": "assert",
41+
"body": [
42+
"assert!($1)$0"
43+
],
44+
"description": "Insert assert!"
45+
},
46+
"assert_eq": {
47+
"prefix": "assert_eq",
48+
"body": [
49+
"assert_eq!($1, $2)$0"
50+
],
51+
"description": "Insert assert_eq!"
52+
},
3953
"macro_rules": {
4054
"prefix": "macro_rules",
4155
"body": [

0 commit comments

Comments
 (0)