Significant newlines, ugh
This commit is contained in:
parent
ac477f8522
commit
16211fe728
@ -35,7 +35,6 @@ snippet pln "println!"
|
|||||||
println!("${1}");
|
println!("${1}");
|
||||||
snippet pln, "println! with format param"
|
snippet pln, "println! with format param"
|
||||||
println!("${1}", ${2});
|
println!("${1}", ${2});
|
||||||
|
|
||||||
# Modules
|
# Modules
|
||||||
snippet ec "extern crate"
|
snippet ec "extern crate"
|
||||||
extern crate ${1:sync};
|
extern crate ${1:sync};
|
||||||
@ -53,7 +52,6 @@ snippet testmod "Test module" b
|
|||||||
|
|
||||||
test${0}
|
test${0}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Attributes
|
# Attributes
|
||||||
snippet allow "allow lint attribute" b
|
snippet allow "allow lint attribute" b
|
||||||
#[allow(${1:unused_variable})]
|
#[allow(${1:unused_variable})]
|
||||||
@ -74,13 +72,11 @@ snippet crate "Define create meta attributes"
|
|||||||
#![comment = "${4:Comment.}"]
|
#![comment = "${4:Comment.}"]
|
||||||
// Specify the output type
|
// Specify the output type
|
||||||
#![crate_type = "${5:lib}"]
|
#![crate_type = "${5:lib}"]
|
||||||
|
|
||||||
# Common types
|
# Common types
|
||||||
snippet opt "Option<T>"
|
snippet opt "Option<T>"
|
||||||
Option<${1:i32}>
|
Option<${1:i32}>
|
||||||
snippet res "Result<T, E>"
|
snippet res "Result<T, E>"
|
||||||
Result<${1:~str}, ${2:()}>
|
Result<${1:~str}, ${2:()}>
|
||||||
|
|
||||||
# Control structures
|
# Control structures
|
||||||
snippet if
|
snippet if
|
||||||
if ${1} {
|
if ${1} {
|
||||||
@ -123,7 +119,6 @@ snippet todo "TODO comment"
|
|||||||
// [TODO]: ${0:Description}
|
// [TODO]: ${0:Description}
|
||||||
snippet fixme "FIXME comment"
|
snippet fixme "FIXME comment"
|
||||||
// FIXME: $0
|
// FIXME: $0
|
||||||
|
|
||||||
# Struct
|
# Struct
|
||||||
snippet st "Struct definition"
|
snippet st "Struct definition"
|
||||||
struct ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} {
|
struct ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} {
|
||||||
@ -165,7 +160,6 @@ snippet ss "static string declaration"
|
|||||||
static ${1}: &'static str = "${0}";
|
static ${1}: &'static str = "${0}";
|
||||||
snippet stat "static item declaration"
|
snippet stat "static item declaration"
|
||||||
static ${1}: ${2:usize} = ${0};
|
static ${1}: ${2:usize} = ${0};
|
||||||
|
|
||||||
# Concurrency
|
# Concurrency
|
||||||
snippet spawn "spawn a task or thread"
|
snippet spawn "spawn a task or thread"
|
||||||
spawn(proc() {
|
spawn(proc() {
|
||||||
@ -173,7 +167,6 @@ snippet spawn "spawn a task or thread"
|
|||||||
});
|
});
|
||||||
snippet chan "Declare (Sender, Receiver) pair of asynchronous channel()"
|
snippet chan "Declare (Sender, Receiver) pair of asynchronous channel()"
|
||||||
let (${1:tx}, ${2:rx}): (Sender<${3:i32}>, Receiver<${4:i32}>) = channel();
|
let (${1:tx}, ${2:rx}): (Sender<${3:i32}>, Receiver<${4:i32}>) = channel();
|
||||||
|
|
||||||
# Testing
|
# Testing
|
||||||
snippet as "assert!"
|
snippet as "assert!"
|
||||||
assert!(${1:predicate})
|
assert!(${1:predicate})
|
||||||
|
Loading…
Reference in New Issue
Block a user