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