Skip to content

Commit 458947b

Browse files
phanschlpil
authored andcommitted
Rust: Improve pri, pln, and fmt
Using the snippets with format args pretty much always means that the format args need to be used using `{}` or `{:?}`. See: https://doc.rust-lang.org/std/fmt/
1 parent 405ea72 commit 458947b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

snippets/rust.snippets

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ snippet lettm "let mut variable declaration with explicit type annotation"
4242
snippet pri "print!"
4343
print!("${1}");
4444
snippet pri, "print! with format param"
45-
print!("${1}", ${2});
45+
print!("{${1}}", ${2});
4646
snippet pln "println!"
4747
println!("${1}");
4848
snippet pln, "println! with format param"
49-
println!("${1}", ${2});
49+
println!("{${1}}", ${2});
5050
snippet fmt "format!"
51-
format!("${1}", ${2});
51+
format!("{${1}}", ${2});
5252

5353
# Modules
5454
snippet ec "extern crate"

0 commit comments

Comments
 (0)