Skip to content

Commit

Permalink
Remove /* code */ placeholders in rust.snippets.
Browse files Browse the repository at this point in the history
  • Loading branch information
dcbishop committed Apr 18, 2014
1 parent dba38fc commit 7af4b8f
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions UltiSnips/rust.snippets
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ priority -50
###############
snippet fn "A function, optionally with arguments and return type."
fn ${1:function_name}(${2})${3/..*/ -> /}${3} {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
${VISUAL}${0}
}
endsnippet

snippet test "Test function"
#[test]
fn ${1:test_function_name}() {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
${VISUAL}${0}
}
endsnippet

Expand Down Expand Up @@ -55,7 +55,7 @@ endsnippet

snippet mod "A mod." b
mod ${1:`!p snip.rv = snip.basename.lower() or "name"`} {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
${VISUAL}${0}
} /* $1 */
endsnippet

Expand Down Expand Up @@ -97,7 +97,7 @@ endsnippet

snippet if "if .. (if)" b
if ${1:/* condition */} {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
${VISUAL}${0}
}
endsnippet

Expand All @@ -109,19 +109,19 @@ endsnippet

snippet while "while .. {}" b
while ${1:condition} {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
${VISUAL}${0}
}
endsnippet

snippet for "for .. in .." b
for ${1:i} in ${2:range(0u, 10)} {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
${VISUAL}${0}
}
endsnippet

snippet spawn "spawn(proc() { .. });" b
spawn(proc() {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
${VISUAL}${0}
});
endsnippet

Expand All @@ -146,13 +146,13 @@ endsnippet
############
snippet st "Struct" b
struct ${1:`!p snip.rv = snip.basename.title() or "name"`} {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
${VISUAL}${0}
}
endsnippet

snippet stn "Struct with new constructor." b
pub struct ${1:`!p snip.rv = snip.basename.title() or "name"`} {
${3:/* code */}
${3}
}

impl $1 {
Expand Down Expand Up @@ -180,14 +180,14 @@ endsnippet
##########
snippet imp "An impl" b
impl ${1:Name} {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
${VISUAL}${0}
}
endsnippet

snippet drop "Drop implementation" b
impl Drop for ${1:Name} {
fn drop(&mut self) {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
${VISUAL}${0}
}
}
endsnippet
Expand All @@ -198,7 +198,7 @@ endsnippet
############
snippet trait "Trait block" b
trait ${1:Name} {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
${VISUAL}${0}
}
endsnippet

Expand Down

0 comments on commit 7af4b8f

Please sign in to comment.