dotfiles/vim/snippets/vim-snippets/UltiSnips/rust.snippets

35 lines
667 B
Plaintext
Raw Normal View History

2018-04-05 13:06:54 +02:00
#######################################################################
# Rust Snippets #
#######################################################################
priority -50
snippet arg "Function Arguments" i
${1:a}: ${2:T}${3:, arg}
endsnippet
snippet || "Closure, anonymous function (inline)" i
${1:move }|$2| { $3 }
endsnippet
snippet |} "Closure, anonymous function (block)" i
${1:move }|$2| {
$3
}
endsnippet
snippet macro "macro_rules!" b
macro_rules! ${1:name} {
(${2:matcher}) => (
$3
)
}
endsnippet
snippet fd "Struct field definition" w
${1:name}: ${2:Type},
endsnippet
# vim:ft=snippets: