Rust: pub fn, correct while trigger
This commit is contained in:
parent
814896e4d2
commit
af3c2d3f66
@ -18,6 +18,12 @@ fn ${1:function_name}(${2})${3/..*/ -> /}${3} {
|
|||||||
}
|
}
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
|
snippet pfn "A public function, optionally with arguments and return type."
|
||||||
|
pub fn ${1:function_name}(${2})${3/..*/ -> /}${3} {
|
||||||
|
${VISUAL}${0}
|
||||||
|
}
|
||||||
|
endsnippet
|
||||||
|
|
||||||
snippet arg "Function Arguments" i
|
snippet arg "Function Arguments" i
|
||||||
${1:a}: ${2:T}${3:, arg}
|
${1:a}: ${2:T}${3:, arg}
|
||||||
endsnippet
|
endsnippet
|
||||||
|
@ -7,6 +7,10 @@ snippet fn "Function definition"
|
|||||||
fn ${1:function_name}(${2})${3} {
|
fn ${1:function_name}(${2})${3} {
|
||||||
${0}
|
${0}
|
||||||
}
|
}
|
||||||
|
snippet pfn "Function definition"
|
||||||
|
pub fn ${1:function_name}(${2})${3} {
|
||||||
|
${0}
|
||||||
|
}
|
||||||
snippet test "Unit test function"
|
snippet test "Unit test function"
|
||||||
#[test]
|
#[test]
|
||||||
fn ${1:test_function_name}() {
|
fn ${1:test_function_name}() {
|
||||||
@ -106,7 +110,7 @@ snippet loop "loop {}" b
|
|||||||
loop {
|
loop {
|
||||||
${0}
|
${0}
|
||||||
}
|
}
|
||||||
snippet while "while loop"
|
snippet wh "while loop"
|
||||||
while ${1:condition} {
|
while ${1:condition} {
|
||||||
${0}
|
${0}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user