2014-04-18 12:58:02 +00:00
|
|
|
#######################################################################
|
|
|
|
# Rust Snippets #
|
|
|
|
#######################################################################
|
|
|
|
|
2014-07-02 11:18:18 +00:00
|
|
|
priority -50
|
|
|
|
|
2015-12-08 13:20:04 +00:00
|
|
|
|
2015-03-14 20:02:10 +00:00
|
|
|
snippet arg "Function Arguments" i
|
|
|
|
${1:a}: ${2:T}${3:, arg}
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet || "Closure, anonymous function (inline)" i
|
2017-02-11 13:01:38 +00:00
|
|
|
${1:move }|$2| { $3 }
|
2015-03-14 20:02:10 +00:00
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet |} "Closure, anonymous function (block)" i
|
2017-02-11 13:01:38 +00:00
|
|
|
${1:move }|$2| {
|
2015-03-14 20:02:10 +00:00
|
|
|
$3
|
|
|
|
}
|
|
|
|
endsnippet
|
|
|
|
|
2014-07-02 11:18:18 +00:00
|
|
|
snippet macro "macro_rules!" b
|
2016-03-14 10:04:57 +00:00
|
|
|
macro_rules! ${1:name} {
|
2014-07-02 11:18:18 +00:00
|
|
|
(${2:matcher}) => (
|
2017-02-11 13:01:38 +00:00
|
|
|
$3
|
2014-07-02 11:18:18 +00:00
|
|
|
)
|
2016-03-14 10:04:57 +00:00
|
|
|
}
|
2014-07-02 11:18:18 +00:00
|
|
|
endsnippet
|
2014-04-18 12:58:02 +00:00
|
|
|
|
2015-03-14 20:02:10 +00:00
|
|
|
snippet fd "Struct field definition" w
|
|
|
|
${1:name}: ${2:Type},
|
|
|
|
endsnippet
|
|
|
|
|
2014-04-18 12:58:02 +00:00
|
|
|
# vim:ft=snippets:
|