2014-04-18 12:58:02 +00:00
|
|
|
#######################################################################
|
|
|
|
# Rust Snippets #
|
|
|
|
#######################################################################
|
|
|
|
|
2014-07-02 11:18:18 +00:00
|
|
|
priority -50
|
|
|
|
|
2020-04-26 01:56:16 +00:00
|
|
|
snippet fn "fn name(?) -> ? {}"
|
2018-12-17 11:28:27 +00:00
|
|
|
fn ${1:function_name}($2)${3/..*/ -> /}$3 {
|
|
|
|
${VISUAL}$0
|
|
|
|
}
|
|
|
|
endsnippet
|
2015-12-08 13:20:04 +00:00
|
|
|
|
2018-12-17 11:28:27 +00:00
|
|
|
snippet pfn "pub fn name(?) -> ? {}"
|
|
|
|
pub fn ${1:function_name}($2)${3/..*/ -> /}$3 {
|
|
|
|
${VISUAL}$0
|
|
|
|
}
|
2015-03-14 20:02:10 +00:00
|
|
|
endsnippet
|
|
|
|
|
2020-05-10 14:24:38 +00:00
|
|
|
snippet afn "async fn name(?) -> ? {}"
|
2020-06-21 15:50:44 +00:00
|
|
|
async fn ${1:function_name}($2)${3/..*/ -> /}$3 {
|
2020-05-10 14:24:38 +00:00
|
|
|
${VISUAL}$0
|
|
|
|
}
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet pafn "pub async fn name(?) -> ? {}"
|
2020-06-21 15:50:44 +00:00
|
|
|
pub async fn ${1:function_name}($2)${3/..*/ -> /}$3 {
|
2020-05-10 14:24:38 +00:00
|
|
|
${VISUAL}$0
|
|
|
|
}
|
|
|
|
endsnippet
|
|
|
|
|
2018-12-17 11:28:27 +00:00
|
|
|
snippet pri "print!(..)" b
|
|
|
|
print!("$1"${2/..*/, /}$2);
|
2015-03-14 20:02:10 +00:00
|
|
|
endsnippet
|
|
|
|
|
2018-12-17 11:28:27 +00:00
|
|
|
snippet pln "println!(..)" b
|
|
|
|
println!("$1"${2/..*/, /}$2);
|
2015-03-14 20:02:10 +00:00
|
|
|
endsnippet
|
|
|
|
|
2018-12-17 11:28:27 +00:00
|
|
|
snippet fmt "format!(..)"
|
|
|
|
format!("$1"${2/..*/, /}$2);
|
2014-07-02 11:18:18 +00:00
|
|
|
endsnippet
|
2014-04-18 12:58:02 +00:00
|
|
|
|
2019-01-08 10:11:54 +00:00
|
|
|
snippet .it ".iter()" i
|
2018-12-17 11:28:27 +00:00
|
|
|
.iter()$0
|
2015-03-14 20:02:10 +00:00
|
|
|
endsnippet
|
|
|
|
|
2020-06-21 15:50:44 +00:00
|
|
|
snippet impl "Struct/Trait implementation" b
|
2020-12-04 21:15:32 +00:00
|
|
|
impl$4 ${1:Type/Trait}${2: for ${3:Type}}${4:<${5:T}>} {
|
|
|
|
${0}
|
2020-06-21 15:50:44 +00:00
|
|
|
}
|
|
|
|
endsnippet
|
|
|
|
|
2014-04-18 12:58:02 +00:00
|
|
|
# vim:ft=snippets:
|